Learn all about Swift with these posts

Swift is a powerful and intuitive programming language for macOS, iOS, watchOS, and tvOS.

New!
How to check if a modifier key is pressed when clicking on a menu bar item in macOS apps

Learn how you can provide different content or functionality when clicking on a menu bar item with a modifier key pressed in macOS apps using both AppKit and SwiftUI.

Using withObservationTracking to monitor changes in @Observable properties outside SwiftUI views

Learn how the Observation module's withObservationTracking function works and how you can use it to observe changes of an @Observable object from anywhere in your codebase.

How to keep your macOS app's menu bar item running after quitting the app

Learn how you can interrupt the app's termination and change your app's activation policy to keep the menu bar item running after the app has been quit.

How to change your app's business model from paid to freemium using StoreKit

Learn how to use StoreKit's AppTransaction API to change your app's business model from a paid app to freemium.

How to listen for property changes in an @Observable class using AsyncStreams

A comparison between ObservableObject and the new Observable macro and how to listen and react to property changes in both.

How to automatically detect memory leaks on CI/CD using UI tests

Learn how to automatically detect memory leaks in your Apple apps using UI tests and Xcode's XCTest framework.

How to programmatically parse the contents of an XCResult bundle

Extract information from tests in an XCResult bundle such as the screen recording of a failing UI test.

How to get the checksum of a file in Swift

Learn how to build a cross-platform Swift method to get the checksum of a file.

How to use recursive functions in Swift

Why, how and when to use functions that call themselves in Swift.

Check if your app has a newer version on the App Store using Swift

How to notify your users that a new version of your app is available on the App Store directly from your app.

Free, on-device translations with the Swift Translation API

During WWDC24, Apple announced the Swift Translation API, a new framework that allows you to perform on-device translations in your Swift apps entirely for free. In this post, we'll take a look at all the different ways you can use the new API to translate text between languages in your apps.

Getting started with Swift Testing

All you need to know about Apple's macro-based testing library available from Xcode 16 and the Swift 6 Toolchain.