(Swift for Beginners) Swift Typealias In this article, you will learn about typealias and its use cases in Swift. A type alias allows you to provide a new name for an existing data type into your program. After a type alias is declared, the aliased name can be used instead of the existing type throughout …
(Swift for Beginners) Swift Closures In this article, you’ll learn what is a closure, syntax, types of closures in Swift with examples. In the article Swift functions, we created a function using func keyword. However, there is another special type of function in Swift, known as closures that can be defined without using keyword func and a function name. Like functions, …
(Swift for Beginners) Swift Function Overloading In this article, you will learn about function overloading, when do we need function overloading and how to overload with examples. Two or more functions having same name but different argument(s) are known as overloaded functions. Why do we need function overloading? Imagine you are developing a shooter game …
(Swift for Beginners) Swift Ranges In this article, you will learn about range, its type and use cases in Swift. A range is an interval of values. A simple example of range is 0,1,2,3,4,5,6,7,8,9 because the numbers are sequential from 0 to 9. We can create range in swift using two range operators described below: …
(Swift for Beginners) Swift Recursion In this article, you will learn to create a recursive function; a function that calls itself. A function that calls itself is known as a recursive function. And, this technique is known as recursion. While creating a recursive function, you must create a condition so that the function does not …
(Swift for Beginners) Swift Nested Functions In this article, you will learn about nested functions in Swift and how it works with examples. If a function exists inside the body of another function, it’s called nested function. Syntax of a nested function func funcname() { //statements of outer function func anotherFuncname() { //statements of inner …
(Swift for Beginners) Swift Function Parameters and Return Values In this article, you’ll learn about different user defined functions that takes inputs of different types and returns output, with examples. In the previous article Swift Functions, we learned about functions. Now, we’ll look at the different ways and types we can create a function in …
(Swift for Beginners) Swift Functions In this article, you’ll learn everything about functions, what is a function, syntax, types in Swift with examples. What is a function? A function is a group of statements that defines an action to be performed. The main use of a function is to make the code reusable. Non technically, …
(Swift for Beginners) Swift Dictionary In this tutorial, you will learn about what dictionary is, creating a dictionary and some common operations in dictionary. In the previous Swift Arrays article, we learned how we can store multiple values in a variable/constant. In this article, we are going to discuss how we can store data/values as …
(Swift for Beginners) Swift Sets In this tutorial, you will learn about sets, creating sets, modifying them and some common operations in sets. In the previous Swift Arrays article, we learned about creating array that can hold multiple values in an ordered list. But, if we have to make sure a list can hold a value only …
(Swift for Beginners) Swift Arrays In this tutorial, you will learn about arrays, creating it, accessing values of an array and some common operations in array. In the previous Swift Data Types article, we learned about creating variables/constants of some Data Type that can hold a single value. But, what if we want to store multiple values …
(Swift for Beginners) Swift guard statement In this article, you will learn to use guard statement to control the flow of your program’s execution. Swift If Statement describes how you can perform actions based on certain condition (boolean value). In this article, we will explore the benefits of guard statement over if statement to control the …