
Events Driven Architecture in iOS with MERLin
If you are not new to iOS development, you know how important is to correctly decouple app components for testability and overall flexibility. Each feature should work independently from the others....
39 posts

If you are not new to iOS development, you know how important is to correctly decouple app components for testability and overall flexibility. Each feature should work independently from the others....

Making sure that your code follows swift coding styles and conventions can be a tedious task. Especially in larger teams. You can easily automate this process by using SwiftLint. SwiftLint is a great...

Coding styles can be a religious topic for some developers. It's one of those topics where everyone has a strong opinion. Opinions aside, once we agree on a coding style and start following it, it's...

Big O notation is a tool we use to estimate how long a program or an algorithm will run. On this blog we've covered a lot of algorithms but we only touched on the big O notation. If you have a degree...

[caption id="attachment_2255" align="alignright" width="300"] image source: wikipedia.org[/caption] Enigma Machine was a famous cipher machine that the germans used during the World War 2. In its...

Bellman-Ford algorithm is a very versatile algorithm for finding the shortest path on an edge weighted directed graph. It differs from Dijkstra's algorithm in that it can handle the negative cycles...

A big problem currently unresolved in the swift world is in regards to enums. Filtering and equating enums in swift is verbose and might require some extra helper function or computed var on the enum...

Edge weighted digraphs can be used for a large number of things. In some cases we want to know if there's a directed cycle between the nodes (or vertices). For example, if we're working on a...

Queue is a simple and widely used data structure that operates on a first in first out principle. Sometimes you can hear them being referred to as FIFO (first in first out) queues. In this article...

Binary search trees are one of the most fundamental data structures in computer science. They are very efficient when inserting and searching for elements. And if you're preparing for a technical...

Last week we've talked about edge weighted digraphs in swift. This week we'll talk about a famous algorithm that's using that data structure. Dijkstra's algorithm is a simple and well-known algorithm...

You've probably heard of graphs in computer science, and you might even be dreading them a bit. After all, graphing algorithms are one of the favourite questions on technical interviews. In this...

Composite pattern is a nice little pattern that will help you manage complex hierarchies. It's commonly used to represent menus and directories/files. In this article we'll go over the theory and...

Iterator pattern is a perfect choice for you when you need to traverse a collection of objects. It's fairly simple and it's so widely used that most collection types implement this pattern in the...

Command pattern is a very simple pattern that allows you to decouple a class that invokes a command from a class that knows how to perform it. This gives you incredible flexibility. In this article...

Chain of responsibility is a well-known pattern that you probably ran into without realising it. In this article we'll continue our journey on design patterns in swift and learn more about chain of...

If your objects can have multiple states, then you should consider implementing a state pattern. In this article we'll cover some theory on state pattern, and then we'll go over an example on how to...

You might be wondering what are throwable optionals. It's simply an optional that will throw when force unwrapping. Throwable optionals don't exist in the swift standard library. In this blog article...

Long long time ago, when I was a student, I wrote a paper on genetic algorithms. This is a really exiting topic for me and I always wanted to create something for iOS using genetic algorithms. This...

It might seem strange at first to write an article on functions in swift. But functions in swift are a bit special and have some pretty cool characteristics. Hopefully by the end of this article...

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...

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...

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...

In the first part of the fantastic world of Codable we tackled just one of the possible problems that in real life could make this amazing language feature hard to use. In this article we will try to...

I was one of those people screaming to the miracle in the WWDC room when they first presented Codable in swift 4. I could not wait to put my hands on this new swift feature and starting using it....

In Swift you'll be constructing objects all the time. It might seem simple at first glance but initializers in Swift are a pretty deep topic. In this article we'll cover designated and convenience...

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...

Last week we covered some basics on Optionals. This week we'll dive in a bit deeper. We'll take a look at the implementation of the optionals, optional chaining, nil-coalescing operator and a few...

Optionals are one of the major language features of Swift. Understanding what they are and how to use them will be crucial if you want to code in Swift. Hopefully, by the end of this article you'll...

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,...

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:...

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...

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...

Generics is one powerful feature of swift that allows us to work with generic types. In this article, we'll cover what generics are, and how to use them in your project. Generics You must have come...

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...

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...

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...

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...

Snakes and Ladders is a popular game that we all played as children. For those of you who are new to the game, it's a simple game played on a board that consists of 10x10 squares. The player moves by...