Category Archives: Swift

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 »

Understanding Operation and OperationQueue in Swift

There are more ways than one to do concurrent operations on iOS. In this article, we’ll cover how to use Operations and OperationQueue to execute concurrent operations. There’s a lot to be said (and written) about concurrency on iOS and I don’t really want to bore you to death by… Read more »

Memory Management in Swift: The Strong, The Weak and The Unowned

If you started your iOS development career in Objective-C, especially pre ARC Objective-C, you’re probably very familiar with the above-mentioned concepts. If you started with Swift, some of them might be a bit murky, hopefully, by the end of this post, you’ll get to know them a bit better. A… Read more »

Design Patterns in Swift: Singleton

      16 Comments on Design Patterns in Swift: Singleton

Everyone has heard of singletons. It’s probably the simplest design pattern there is, yet, there are a few catches when implementing it. In this post, I’ll go over the singleton design pattern and the little gotchas that might end up in a crash or an inconsistent state of the app. Singleton… Read more »

Binary Search Array Extension in Swift

      7 Comments on Binary Search Array Extension in Swift

There are more than a few search algorithms. Today we’ll examine one of them, the Binary Search Algorithm, and we’ll implement this algorithm using an array extension in swift. We’ll also compare the performance of this algorithm to your standard brute force search, and see how it compares. Binary Search Algorithm… Read more »

Implementing Common Sorting Algorithms in Swift

Sorting algorithms are an important feature of modern computing, and in this article we’ll examine some of the most common sorting algorithms in use today. Implementations of these algorithms will be done in swift, but they are language agnostic, and you should have on problems implementing them in a language… Read more »

Implementing a Stack Using a Linked List Data Structure

In computer science there are many data structures. In this post we will examine one such structure called a ‘Stack’. We’ll implement it using another data structure called a ‘Linked List’, and for the sake of comparison, we will implement the same stack data structure using plain old arrays, and… Read more »