Learn Something New

A series of one-off tutorials designed to help expand your knowledge of Swift, SwiftUI, and more. Sometimes they will be practical and contain knowledge you can apply straight away, other times we'll just explore fun quirks and curiosities of coding for Apple platforms, but you'll definitely learn something new!

Swift

Tutorials about the Swift language itself.

Using Codable with protocols

17:16

1. Using Codable with protocols

It's easy to encode an array of objects that have the same type, but how can you handle an array of objects with a different type? In this tutorial I'll show you exactly how to do it with a simple and effective approach.

The pitfalls of string bridging

23:09

2. The pitfalls of string bridging

Swift's strings are designed to work flawlessly with languages around the world, but sometimes – just sometimes – you need to be careful using them. Let's explore why…

Inside Swift hashing

31:41

3. Inside Swift hashing

Did you know it's possible for two things to be considered equal even when they aren't the same? Let's look at how hashing works in Swift, how we can tweak it for performance, what problems it can cause, and most importantly how to make sure those problems never strike your code.

Printing vs dumping

11:41

4. Printing vs dumping

Everyone knows the print() function, not least because it's often our first port of call when debugging. But printing in Swift can be so much more powerful! Let's dig in…

Actors and actor reentrancy

17:01

5. Actors and actor reentrancy

Swift's actors are an incredibly powerful way to schedule work safely, but they have a catch: actors allow reentrant code, which can cause surprising problems. Let's explore how actors work, and how reentrancy can catch you out…

Xcode

Tutorials to help you make better use of Xcode.

Personalizing your Xcode header

16:11

1. Personalizing your Xcode header

We make new files in Xcode all the time, but if you spend just a few minutes you can customize the comments that are automatically placed at the start to make them suit you much better.