Type

What does the associated type mean in Swift 5+?

The associated type in Swift gives a placeholder name to a type that will be used as part of the protocol. When the protocol is conformed, the actual type to use for that it is specified. The associated type makes the protocol generic by…

How to use defer in Swift?

Using defer keyword in Swift code is uncommon. But, It is a very powerful concept for certain use case. The code block inside defer statement is executed just before transferring program control. It does not matter how program control is…