Category Archives: Swift

Design Patterns in Swift: Observer

      3 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

      2 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 »

Structures vs Classes in Swift

      6 Comments on Structures vs Classes in Swift

You might have heard that some of the swift native types are being converted from classes to structures. In this article, we’ll explore structures and classes, we’ll talk about values, references, stacks and heaps. Hopefully, by the end of it, you’ll understand the differences between them. Reference Types and Value… Read more »