View controllers tend to play a very central part in the apps we build. However, many view controllers end up taking on too many responsibilities, resulting in lots of intertwined logic, often mixed with view and layout code.

This week, let’s take a look at a technique that lets us mitigate that problem by extracting our view controllers’ core actions, without having to introduce any additional abstractions or architectural concepts.

One major benefit of Swift’s protocol-oriented design is that it enables us to write generic code that’s compatible with a wide range of types, especially if such generic code targets one of the protocols found within the standard library.

This week, let’s take a look at how we can wrap the Sequence protocol in generic containers, that’ll let us encapsulate various algorithms behind easy-to-use APIs.

Pure functions might seem like a mostly theoretical concept at first, but they have the potential to give us some very real, practical benefits — from increased reuse and testability, to more predictable code.

This week, let’s take a look at how pure functions might be used in Swift — and how we can apply them to solve real problems in a very nice way.

Establishing a solid structure within a code base is often essential in order to make it easier to work with. That tends to be especially true for model code, which is often used by many different features with various requirements.

This week, let’s take a look at a few different techniques for structuring the data that makes up our core models, and how improving that structure can have a big positive impact on the rest of our code base.

Being able to observe changes in various values is essential for many different kinds of programming styles and techniques.

While there are a number of abstractions that we can create to be able to observe and communicate such value changes in different ways — Swift comes built-in with a simple, yet powerful way to attach observations to any kind of non-lazy, stored property — appropriately named property observers.

Everyone is an API designer. While it’s easy to think of APIs as something that’s only relevant for packaged code, like SDKs or frameworks, it turns out that all app developers design APIs almost every single day.

This week, let’s take a look at a number of tips and techniques that can be good to keep in mind when designing various APIs in Swift — and how we can create APIs that are both easy to use, and powerful, at the same time.

Being able to express basic values using inline literals is an essential feature in most programming languages.

This week, let’s focus on string literals in particular, by taking a take a look at the many different ways that they can be used and how we — through Swift’s highly protocol-oriented design — are able to customize the way literals are interpreted.

Arguably one of the most challenging aspects of building apps for most platforms is making sure that the UI we present to the user always remains in sync with our underlying data models, and many techniques have been invented in order to address this problem.

This week, let’s take a look at one such technique — that involves binding our model values to our UI.

A situation that most Swift developers will encounter at one point or another, is when some form of type erasure is needed to be able to reference a generic protocol. This week, let’s start by taking a look at what makes type erasure such an essential technique in Swift, and then move on to explore different “flavors” of implementing it — and how each flavor comes with its own set of pros and cons.

Almost every program on the planet has to deal with strings one way or another, since text is so fundamental to how we both communicate and represent various forms of data.

This week, let’s take a look at various ways to parse and extract information from strings, and how different techniques and APIs will yield a different set of trade-offs.

When writing any kind of automated tests, it can sometimes be tricky to achieve a balance between making tests run efficiently and predictably, while still exercising the right code paths under realistic conditions.

One way to get closer to that kind of balance is to use multiple kinds of automated tests, each with a different level of artificialness. This week, let’s take a look at one such kind of tests - verifying the integration between multiple code units.

The UserDefaults API can at first glance appear to be both really simple and somewhat limited.

However, appearances can be deceiving, and it turns out that the power of UserDefaults extends far beyond simply storing and loading basic value types. This week, let’s take a look at what some of that power comes from, and how we can appropriately make use of it in the apps that we build.

One really elegant aspect of Swift’s design is how it manages to hide much of its power behind much simpler programming constructs.

Pattern matching is one source of that power, especially considering how it’s integrated into many different aspects of the language. This week, let’s take a look at a few of those aspects — and how pattern matching unlocks coding styles that can prove to be both really convenient and quite elegant.

One way to make a code base easier to navigate, while still maintaining a solid overall structure, is to inline functionality whenever two pieces of code are heavily related.

This week, let’s take a look at how that can be done using inline types and functions, and how — when tactically deployed in the right situations — it can make our code a bit easier to follow.

Reflection is a common programming language feature that enables us to inspect, and work with, the members of a type — dynamically, at runtime.

That may seem at odds with Swift’s heavy focus on compile-time validation — but this week, let’s take a look at when reflection can come in handy, and how it can let us automate tasks by working with our code in a more dynamic fashion.

Just like sequential code, concurrent code can come in many different shapes and forms. Depending on what we’re trying to achieve, the abstraction that’ll prove to be the best fit might vary quite a lot from use case to use case.

One such abstraction is Tasks, and this week, let’s take a look at some scenarios in which they can become really useful.

When writing automated tests, such as unit tests, many of us have a tendency to focus mostly on verifying that our code behaves correctly under ideal conditions, but we should ideally also test how our code behaves when something goes wrong.

This week, let’s take a look at how unit tests can be used not only to verify correct outcomes — but to verify the correctness of the errors that our code can produce as well.

Whether or not syntactic sugar and other mostly cosmetic code changes actually add value, or whether they cause confusion and complexity, is a common source of debate among developers.

What we ideally want is to be able to strike a nice balance between low verbosity and clarity, and this week, let’s take a look at a few different ways that type aliases can enable us to do just that.

We might not realize it, but most of us share code with other people every single day. However, sharing code in a way that’s clear and effective can be quite difficult — and it’s easy for misunderstandings to happen, and for bugs to start occurring because an API was used “the wrong way”.

So for the 100th weekly article on this site — let’s take a look at what goes into sharing code in a nice way, and some techniques that we can employ to make any code that we share easier to understand.

Networking is a particularly interesting topic when it comes to app development. On one hand, it's something that most apps need — and on the other hand it's something that can be really tricky to get right.

This week, let's take a look at a take on writing networking code that utilizes Apple's built-in URLSession API — but augments it using both Futures & Promises, as well as several functional programming concepts.