Pragmatic Unit Testing in Swift

Continue reading


@swiftbysundell.com | 4 years ago

Managing Dependencies Using the Swift Package Manager

Continue reading


@swiftbysundell.com | 4 years ago

Alternatives to Protocols in Swift

Continue reading


@swiftbysundell.com | 4 years ago

Computing Dates in Swift

Continue reading


@swiftbysundell.com | 4 years ago

Swift Basics: Closures

Continue reading


@swiftbysundell.com | 4 years ago

Small but significant improvements in Swift 5.1

Continue reading


@swiftbysundell.com | 4 years ago

SwiftUI Basics

Continue reading


@swiftbysundell.com | 4 years ago

Reducers in Swift

Continue reading


@swiftbysundell.com | 4 years ago

Swift by Sundell

Continue reading


@swiftbysundell.com | 4 years ago

Picking the right data structure in Swift

This week, let’s take a look at a few key characteristics of the most common Swift data structures, and also how we sometimes might need to venture outside the realm of the standard library to find the right data structure for our needs. | Continue reading


@swiftbysundell.com | 4 years ago

Caching in Swift

Let’s take a look at how caching can be an incredibly powerful tool in various situations, how to build an efficient and elegant caching API in Swift, and how strategically caching various values and objects can have a big impact on the overall performance of an app. | Continue reading


@swiftbysundell.com | 4 years ago

The Power of Subscripts in Swift

This week, let’s take a look at how subscripting works in Swift, and a few different ways to incorporate it into the way we design APIs — including some brand new capabilities that are being added in Swift 5.1. | Continue reading


@swiftbysundell.com | 4 years ago

Computed Properties in Swift

This week, let’s take a look at convenient, but sometimes divisive language feature — computed properties — and how they can let us build really elegant convenience APIs, how to avoid accidentally hiding performance problems when deploying them, and a few different strategies for … | Continue reading


@swiftbysundell.com | 4 years ago

Phantom Types in Swift

This week, let’s take a look at a technique that can let us leverage Swift’s type system to perform data validation at compile time — removing potential sources of ambiguity, and helping us preserve type safety throughout our code base — by using phantom types. | Continue reading


@swiftbysundell.com | 4 years ago

“Swift’s past, present and future”, with special guest Chris Lattner

Chris Lattner, creator of Swift, joins John on this 50th episode of the show — to discuss the current state of Swift and how it came to be, as well as to speculate about what the future of the language and its ecosystem might look like. | Continue reading


@swiftbysundell.com | 4 years ago

Rule-Based Logic in Swift

When thinking about code architecture or system design, it’s quite easy to only think about big-picture, overarching concepts — but most often we can also make a big impact on the quality of our code base by improving some of the more minor details. This week, let’s take a look a … | Continue reading


@swiftbysundell.com | 4 years ago

Utilizing Value Semantics in Swift

One really interesting aspect of Swift’s overall design is how centered it is around the concept of value types. This week, let’s take a look at a few different ways in which we can make use of the semantics of value types — and how doing so could significantly improve the flexib … | Continue reading


@swiftbysundell.com | 4 years ago

Generalizing Swift Code

Deciding whether or not to generalize a piece of code to fit more than one use case can sometimes be quite tricky. This week, let’s take a look at a few key factors that can help us strike a nice balance between being able to reuse as much of our code as possible, while also avo … | Continue reading


@swiftbysundell.com | 4 years ago

Customizing Codable Types in Swift

This week, let’s take a look at a few different ways that we can tweak the way Swift’s Codable API works, and how doing so can let us bridge many of the differences between our Swift types and the serialized data used to represent them — without having to fall back to implementin … | Continue reading


@swiftbysundell.com | 4 years ago

Defining Testing Data in Swift

While a big part of writing testable code comes down to how our dependencies are managed, how we structure and manage our testing data is often equally important. This week, let’s take a look at a few different techniques that can enable us to define such data more easily — and h … | Continue reading


@swiftbysundell.com | 4 years ago

Configurable Types in Swift

Even though most of our classes, structs, and other types might have initially been created to solve a very specific problem — over time, we quite often find ourselves wanting to use a highly similar version of that same type or logic, but for something entirely different. This w … | Continue reading


@swiftbysundell.com | 4 years ago

Shifting Paradigms in Swift

This week, let’s take a look at a few techniques that we can use to prepare ourselves for undergoing major paradigm shifts when it comes to the APIs and technologies that we use to build apps — using the shift from imperative UI development with UIKit to the declarative nature of … | Continue reading


@swiftbysundell.com | 4 years ago

The Swift 5.1 features that power SwiftUI’s API

SwiftUI brings a new, decarative way to build UIs for Apple’s platforms, and also pushes the Swift language itself to new limits — by making heavy use of a set of key new syntax features, that are being introduced as part of Swift 5.1, in order to provide a very DSL-like&nbs … | Continue reading


@swiftbysundell.com | 4 years ago

A Swift Developer’s WWDC Dreams

The start of WWDC 2019 is now just hours away, and — like most developers working within the Apple ecosystem — I’m getting really excited. While there’s already been a ton of predictions, rumors and leaks posted about what we might see from Apple’s biggest developer ev … | Continue reading


@swiftbysundell.com | 4 years ago

Review: Swift Playgrounds 3.0 for iPad

This week, let’s take a look at how well the new 3.0 version of the Swift Playgrounds app for iPad walks the balance between simplicity and power, and how some of its new features really improves the ways it can be used as a highly portable, advanced Swift development tool. | Continue reading


@swiftbysundell.com | 4 years ago

Wrapping Sequences in Swift

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 … | Continue reading


@swiftbysundell.com | 5 years ago

Pure Functions in Swift

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 … | Continue reading


@swiftbysundell.com | 5 years ago

Structuring Model Data in Swift

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 differen … | Continue reading


@swiftbysundell.com | 5 years ago

Designing Swift APIs

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 t … | Continue reading


@swiftbysundell.com | 5 years ago

String Literals in Swift

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 p … | Continue reading


@swiftbysundell.com | 5 years ago

Different flavors of type erasure in Swift

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 … | Continue reading


@swiftbysundell.com | 5 years ago

Task-based concurrency in Swift

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 very quite a lot from use case to use case. One such abstraction is Tasks, and this week, let … | Continue reading


@swiftbysundell.com | 5 years ago

Testing error code paths in Swift

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 … | Continue reading


@swiftbysundell.com | 5 years ago

Power of type aliases in Swift

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 an … | Continue reading


@swiftbysundell.com | 5 years ago

Sharing Swift code

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 wr … | Continue reading


@swiftbysundell.com | 5 years ago

Functional networking in Swift

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 … | Continue reading


@swiftbysundell.com | 5 years ago

Swift playgrounds tips and tricks

Designed to be an easy way to quickly prototype a piece of Swift code, to learn the language, or to explore the standard library and Apple’s SDKs — Swift playgrounds have become an integral part of many developers’ daily workflows. This week, let’s take a look at some tips and t … | Continue reading


@swiftbysundell.com | 5 years ago

Slot-based UI development in Swift

One of the most challenging decisions that all programmers have to make on an ongoing basis is when to generalize a solution versus just keeping it tied to a specific use case. This week — let’s take a look at a way of building UIs that might allow us to strike a nice balance be … | Continue reading


@swiftbysundell.com | 5 years ago

Using errors as control flow in Swift

How we manage the control flow within the apps and systems that we work on can have a huge impact on everything from how fast our code executes, to how easy it is to debug. This week, let's take a look at how we can use Swift's built-in error throwing and handling model to make … | Continue reading


@swiftbysundell.com | 5 years ago

Managing Objects Using Locks and Keys in Swift

One of the most important roles of any software architecture is to make the relationships between the various objects and values within an application as clear and well-defined as possible. This week, let's take a look at how we can do that by using Swift's powerful type system … | Continue reading


@swiftbysundell.com | 5 years ago

Extending optionals in Swift

A really elegant aspect of Swift's implementation of optionals, is that a large part of this feature is implemented using the type system - since all optional values are actually represented using an enum under the hood. That gives us some interesting capabilities, since we … | Continue reading


@swiftbysundell.com | 5 years ago

Building iPad Pro features in Swift

Whether or not you believe that the iPad is the future of computing, it does bring a ton of interesting new features and capabilities to the table - especially with the latest release of the Pro version. This week, let’s take a look at how we as third-party developers can take a … | Continue reading


@swiftbysundell.com | 5 years ago

Avoiding race conditions in Swift

A race condition is what happens when the expected completion order of a sequence of operations becomes unpredictable, causing our program logic to end up in an undefined state. This week, let's take a look at a common scenario that can cause race conditions, possible ways to av … | Continue reading


@swiftbysundell.com | 5 years ago

Specializing protocols in Swift

Protocols continue to be an integral part of Swift - both in terms of how the language itself is designed, and also in how the standard library is structured. This week, let's take a look at how we can use protocols to create multiple levels of abstraction, and try out a few dif … | Continue reading


@swiftbysundell.com | 5 years ago

Building DSLs in Swift

A DSL, short for Domain Specific Language, can be explained as a special kind of API that focuses on providing a simple syntax that's tailored to working within a specific domain. While DSLs are often written in more dynamic languages, such as Ruby - Swift's type inference … | Continue reading


@swiftbysundell.com | 5 years ago

Writing backward compatible Swift code

Adding new features to existing code can be really challenging - especially if that code is heavily used throughout one or many projects. Backward compatibility can in many ways help us make such changes in a much smoother fashion, so this week, let's take a look at a few differe … | Continue reading


@swiftbysundell.com | 5 years ago

The power of Result types in Swift

This week, let's explore various versions of the commonly used Result type, and some of the cool things it lets us do when combined with some of Swift's language features. | Continue reading


@swiftbysundell.com | 5 years ago