Swift programming

Swift programming for Beginners – Swift Closures

Hits: 10 (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. …

Swift programming for Beginners – Swift Function Overloading

Hits: 16 (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 …

Swift programming for Beginners – Swift Nested Functions

Hits: 16 (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 …

Swift programming for Beginners – Swift Function Parameters and Return Values

Hits: 2 (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 …

Swift programming for Beginners – Swift while and repeat while Loop

Hits: 6 (Swift for Beginners) Swift while and repeat while Loop In this article, you will learn to create while and repeat…while loops in Swift programming. In the previous article, we learned about for-in loop to run a set of tasks for a certain number of times. In this article, you will learn to use while and repeat..while as an alternative …