(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 …
Day: December 9, 2020
(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 …