Tag Archives: swift

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 »

DispatchGroup vs. OperationQueue in Swift

      4 Comments on DispatchGroup vs. OperationQueue in Swift

You probably found yourself in a situation where you had to do a bunch of asynchronous tasks and you just wanted to get notified when all of them finish. There are two easy ways of doing this: DispatchGroup and OperationQueue. We’ll cover them both in this post. The Story We’ll… Read more »