Swift Swift Closures We can think of closure as simply another way to write a function. It is simply a block of code that can be passed around to other functions. No parameter Let's say a simple function that receives no parameter and returns void: func doSomething() { //Do some work } This
Swift Delegates & Protocols Delegates and protocols are concepts commonly used in the Swift programming language, which is primarily used for iOS and macOS app development. They are fundamental building blocks for creating flexible and extensible code by enabling communication between different parts of an application. 1. Delegates: * A delegate is a design pattern