Chapters

Hide chapters

SwiftUI Cookbook

Live Edition · iOS 16.4 · Swift 5.8.1 · Xcode 14.3.1

Configuring the Deployment Target for SwiftUI Apps
Written by Team Kodeco

When developing a SwiftUI app, it’s crucial to define your deployment target, which specifies the minimum iOS version on which your app can run. Setting this target balances the need to leverage the latest iOS features against ensuring your app’s compatibility with older devices.

To set your deployment target in Xcode, follow these steps:

  1. Select your project in the project navigator.
    Select the project in the project navigator.
    Select the project in the project navigator.
  2. Choose your app under Targets.
    Choose you app under Targets.
    Choose you app under Targets.
  3. In the General tab, find the Minimum Deployments section.
    Find Minimum Deployments.
    Find Minimum Deployments.
  4. Choose your desired iOS version from the iOS Deployment Target dropdown. This specifies the earliest version of the iOS that your app can run on.
    Select a minimum deployment version.
    Select a minimum deployment version.

Your chosen deployment target impacts your app’s reach and functionality. If you set a high deployment target (say, iOS 16), your app can use the latest iOS features, but it will not be available to users on devices running older iOS versions. Conversely, a lower deployment target (for example, iOS 13) means more users can download your app, but you might not be able to use some newer features.

In general, a good rule of thumb is to support the most recent couple versions. So if the latest deployment is iOS 16, you’d support back to either iOS 15 or iOS 14.

In conclusion, the deployment target is a strategic choice based on your desired app functionality and the range of devices you aim to support.

Have a technical question? Want to report a bug? You can ask questions and report bugs to the book authors in our official book forum here.
© 2024 Kodeco Inc.