Category Archives: Swift

Design Patterns in Swift: Observer

      No Comments on Design Patterns in Swift: Observer

Continuing on our journey with design patterns, this week we’ll visit the observer pattern. This is a really simple pattern to implement. We’ll quickly go through some theory and get down to business. Hopefully, by the end of the article, you’ll be using the pattern in your projects. The Observer… Read more »

Swift Sorting Algorithm

      No Comments on Swift Sorting Algorithm

Early this year Dejan wrote an amazing article about sorting algorithms. In this article he was comparing common sorting algorithms with the swift sorting algorithm. What we could observe from his conclusion is that swift sorting algorithm is a lot faster than any other concurrent. Now that swift is open… Read more »

Design Patterns in Swift: Abstract Factory

      No Comments on Design Patterns in Swift: Abstract Factory

Abstract factory is one of the creational design patterns. You probably encountered it in your development without realising. Here we’ll cover the swift version of the text-book version of the design pattern and say a few words about the dependency inversion principle. Abstract Factory We’re all taught to code to… Read more »

Assert, Precondition and Fatal Error in Swift

Sometimes it’s better to crash then to have your app running in an inconsistent state. In this short article we’ll cover the options you have for crashing and what are the main differences between them. There’s only five, with some subtle differences. Let’s dive in. Five Ways to Fail You… Read more »