Singletons in Swift

Some people love it, some people hate it – but in the end everybody uses it: the singleton pattern. It is used if just one instance of an object is desired. For example, that could be a database connection. 

Published
Categorized as Swift

Outsource your UITableViewDataSource!

It is very common that the controller of an UITableView is also its data source. This is the number one reason why view controllers tend to become very massive. Outsourcing the data source to an object on its own is a better solution.

Published
Categorized as UIKit

One Year of Swift

One year ago Apple introduced Swift, which was a very surprising move.  What remains after one year?

Published
Categorized as Swift

The 10 Best Xcode Shortcuts

Keyboard shortcuts can make your life better – or at least your workflow quicker. Here’s a list of the ten best ones:

Published
Categorized as Xcode

Swift 2.0: defer

defer is another new keyword in Swift. With this statement you can declare clean-up code, that is executed just before the current scope ends. For example, this scope can be a function or a loop.

Published
Categorized as Swift

Swift 2: guard

In Swift 2, there is a new keyword for handling the control-flow of a block of code. It guarantees, that a specific condition holds true for the further code. Otherwise, it ensures that the following code will not be executed. Let us start with a simple example. Imagine you have a function, that has an optional… Continue reading Swift 2: guard

Published
Categorized as Swift