Structures 101 in swift

Structures is not another type in swift. If you have background in C or objective C you will be impressed with the functionality of structs in swift. Structures have initialisers, methods, comfort to protocols have extensions…convinced? Well, if start thinking that are like classes you are right but…only similar. Major difference is that structures are

Continue reading Structures 101 in swift

Closures 101 in swift

Closures, what a great tool! Once you get it, you love it. Closures are the famous blocks in Objective-C. Maybe were a bit difficult to understand at first sight. I’ve written three parts in this blog to explain them. However now everything is easier. Closures are vital part in Swift and we will experiment with

Continue reading Closures 101 in swift

Functions 101 in swift

Functions are the building blocks of any application. Let’s start with some obvious characteristics about them. The functions declared using the keyword func. Then follows the function name and the parenthesis containing the parameters, after that there is an arrow “->” and the return type is defined. So, it looks like: Inside the function, we

Continue reading Functions 101 in swift