Information is at the heart of nearly every iOS application we write. Information comes in, we write code to process it, we make decisions based on that information and then potentially take some action. But how exactly do we make those decisions?
Swift Loops
When writing code in Swift, it is not uncommon to want to repeat the execution of a set of statements. Controlling the position of different characters in a game, looping through the photos in a library, looping over a list of tweets – they all require re-executing the same set of statements multiple times. In […]
Lifetime, Scope and Namespaces in Swift
In this article, we are going to look at the different options we have available in Swift for organising our code before looking at the closely related concepts of lifetime, scope and namespaces.
Dictionaries in Swift
Arrays, dictionaries and sets make up the three main collection types in Swift. We’ve already talked about Arrays in a previous post, and in this article, we’re going to move on and look at the second of these collection types: Dictionaries.
Precedence, Associativity and the Swift Operators
In today’s post we’re going to take a look at the different types of operators that are available in Swift. We’ll take a closer look at how the Swift compiler interprets the symbols and tokens we include in our source code and look at how the concepts of precedence and associativity play a key role in shaping the results of our expressions.
Variables and Constants in Swift
Like in C and Objective-C and pretty much every other programming language in existence, Swift uses constants and variables to store the values in your application. In this article, we’re going to look at variables and constants in Swift. Rules for Naming Variables As with other languages, constants and variables in Swift associate a name […]