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 for finding a shortest path between two points on a graph. In this article we’ll implement Dijkstra’s algorithm in… Read more »
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 article we’ll implement the edge-weighted digraph in swift. This is an essential structure that we’ll use later on… Read more »
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 learn on an example how to implement this pattern. We’ll use a slightly more colourful example, just to keep… Read more »
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 swift standard library. In this article you’ll learn how to implement the iterator pattern. This will… Read more »
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 we’ll go over the theory of what command pattern is after which we’ll follow-up with… Read more »
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 responsibility pattern. We’ll cover some theory at first and then we’ll implement a cascading cache with an… Read more »
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 implement it. Hopefully, by the end of the article, you’ll be familiar with the state… Read more »
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 we’ll create them and we’ll create a custom operator for them as well. This article has been inspired by… Read more »
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 article was a long time coming, I hope you’ll enjoy it… Traveling salesman… Read more »
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 you’ll understand them better. Three Things to Remember There are only three things that you… Read more »