Swift
Learn more and get better in Swift using this list of Swift blog posts, tutorials, tips, and tricks.
Sendable and @Sendable closures explained with code examples
Sendable is a protocol in Swift that indicates a type is safe to share across concurrency domains like actors, tasks, and threads. When a type conforms to Sendable, the compiler verifies at compile time that passing it around can't introduce data races. Together with the @Sendable attribute for closures, it's ...
@MainActor in Swift explained with code examples
@MainActor is a global actor that performs its tasks on the main thread. You can use it to dispatch to the main thread by marking properties, methods, instances, or closures with the attribute. Instead of manually dispatching using DispatchQueue.main.async, you let the compiler enforce main thread execution for you. If ...
Defer in Swift explained with Code Examples
Although the defer keyword was already introduced in Swift 2.0, it's still quite uncommon to use it in projects. Its usage can be hard to understand, but using it can improve your code a lot in some places. The most common use case seen around is opening and closing a ...
What are you shipping this month?Shipaton starts August 1. Build a mobile app, publish it to the App Store or Google Play, and compete with developers around the world. Whether it's your first app or your tenth, the goal is simple: ship something real. Learn more.
Memberwise Initializer in Swift explained with Code Examples
Memberwise initializers in Swift allow you to create struct instances without manually writing an initializer. The compiler examines the stored properties of your struct and automatically generates an initializer that accepts values for them. This feature is one of the reasons why structs are so lightweight to use in Swift ...
Swift 6.4: What’s New in Concurrency
Apple released Swift 6.4 during WWDC 2026, introducing a range of convenience improvements for both the general Swift language and the Concurrency APIs. While Swift is open-source, many of the changes might still have surprised you. At the same time, WWDC sessions do not cover all the new changes (if ...
Swift Computed Property: Code Examples
Computed properties are part of a family of property types in Swift. Stored properties are the most common, saving and returning a stored value, whereas computed ones are a bit different. A computed property, it's all in the name, computes its property upon request. It can be a valuable addition ...
Property Wrappers in Swift explained with code examples
Property Wrappers in Swift enable you to extract common logic into a separate wrapper object. Introduced at WWDC 2019 and available since Swift 5, this feature is a useful addition to the Swift library that helps eliminate much of the boilerplate code we often write in our projects. You can ...
Async await in Swift explained with code examples
Async await is part of the new structured concurrency changes that arrived in Swift 5.5 during WWDC 2021. Concurrency in Swift means allowing multiple pieces of code to run at the same time. This is a very simplified description, but it should give you an idea already of how important ...
Swift Concurrency & Swift 6 Course (Launch offer)
A Swift Concurrency Course that helps you learn all the fundamentals of Swift Concurrency and migrate your projects smoothly to Swift 6 strict concurrency checking. It can be intimidating to start migrating existing projects to Swift 6 and learn about async/await, sendable, and actors simultaneously. A graceful learning process can ...
#Playground Macro: Running Code Snippets in Xcode’s canvas
Xcode 26 introduced a new #Playground macro that allows you to run code snippets and preview them in Xcode's canvas. It's a great way to quickly experiment with code inside your projects without having to define an individual .playground file. Having this all integrated inside Xcode feels great and will ...
@concurrent explained with code examples
Swift 6.2 introduced many changes during WWDC 2025, including a new @concurrent attribute we need when working with Swift Concurrency. You might have read that we'll be able to @MainActor all the things now, which also means we need a way out of the @MainActor for asynchronous functions. For the ...