Assertions are not only an essential tool when writing tests - they're also super useful in order to write more predictable and easier to debug code.

This week, let's look deeper into assertions, how they work and how we can implement our own assert() functions for performing various checks.

Shared state is a really common source of bugs in most apps. It's what happens when you (accidentally or by design) have multiple parts of a system that rely on the same mutable state.

This week, let's take a look at how shared state can be avoided in many situations, by using the factory pattern to create clearly separated instances that each manage their own state.

If you have ever pushed a pixel onto the screen of an Apple device, you have used Core Animation - either directly or indirectly. 

In this new (non-consecutive) series of posts - "Core Animation Gems" - we'll take a closer look at some less widely known features and APIs, and how they can be used to solve problems related to animation and rendering in a nice way. This week, let's kick it off with the first one - CAReplicatorLayer.

An important part of maintaining any app, framework or system is dealing with legacy code. No matter how well architected a system is, legacy will always be built up over time - it can be because of changes in an underlying SDK, because of an expanded feature set, or simply because no one on the team really knows how a particular part works.

This week, let's take a look at a technique that I usually use when dealing with legacy code - that lets you replace a problematic system class by class, rather than having to do it all at once.

Asynchronous programming is arguably one of the hardest parts of building most apps. Because of this, many solutions have been invented to try to combat the above problem - basically creating abstractions around asynchronous programming to make it easier to understand and reason about.

This week, let's take a look at one such solution - Futures & Promises - and go a bit "under the hood" to see how they actually work.

Flakiness is what happens when tests don't run consistently - when you get different outcomes depending on time, which machine they're being run on, or whether they're run on CI or on the computer you work on.

This week, let's take a look at some easy-to-apply tips and tricks that can help you reduce flakiness in your tests, and make them more predictable and easier to run in any environment.

We often encounter situations when we need to find a way to store objects based on some concept of identity. Whether it's in a cache, storing representations of objects on disk, or simply using a dictionary - we often need to find ways to uniquely identify objects that we deal with.

Let's take a look at some of those ways, and how we can use them for objects and values.

Almost all modern apps use JSON in one way or another. Whether it's for configurations, to store local data or to download information over the network - JSON is everywhere.

This week, let's take a look at how we can set up our JSON mapping tests to make them a lot more robust and future proof, and how we can use them to perform end-to-end testing.

One of the hardest things when building apps and designing systems is deciding how to model and deal with state. Code managing state is also a very common source of bugs, when parts of our app might end up in a state we didn't expect.

This week, let's take a look at some techniques that can make it easier to write code that handles and reacts to state changes - to make it more robust and less error prone.

Animations are a great way to explain the functionality of our apps through motion, and to delight our users. Adding animations in the right places can really make a UI look a lot more polished and nice.

This week, let's take a look at how SpriteKit can be a great tool for creating certain kinds of animations.

Swift playgrounds are awesome for things like trying out new frameworks and exploring new language features. The instant feedback they give you can really provide a huge productivity boost and enable you to try out new ideas and solutions quickly.

This week, let’s take a look at how Swift playgrounds can be used for writing unit tests, and how it can make a TDD(ish) workflow a lot more smooth.

Swift 4 introduces a new, refined string API that is easier to use, more powerful, and gives the programmer more control in terms of memory management. This week, let’s take a look at how it is to work with strings in Swift 4, and how we can take advantage of the new, improved API in various situations.

Grand Central Dispatch is one of those fundamental technologies that most Swift developers have used countless times. This week, let’s go beyond async and take a look at some situations where GCD can be really useful, and how it can provide simpler (and more “Swifty”) options to many other Foundation APIs.

UI testing is a great way to ensure that your most critical UI interactions keep working as you’re adding new features or refactoring your app’s codebase. It’s also a nice way to automate repetitive tasks when working on UI code (when you have to navigate deep into your app in order to test something you’re working on, for example).

Lazy properties allow you to create certain parts of a Swift type when needed, rather than doing it as part of its initialization process.  This can be useful in order to avoid optionals, or to improve performance when certain properties might be expensive to create. This week, let’s take a look at a few ways to define lazy properties in Swift, and how different techniques are useful in different situations.