Settings
A group of build settings configuration for projects and targets.Overview
TheSettings type allows you to define build settings, configurations, and xcconfig files for both projects and targets. Settings can be defined at different levels and are merged according to Xcode’s build setting resolution rules.
Basic Usage
Custom Configurations
With XCConfig Files
Simple Settings (Default Configurations)
.settings() Method
Creates settings with default Debug and Release configurations.
SettingsDictionary
default:"[:]"
A dictionary with build settings inherited by all configurations.
SettingsDictionary
default:"[:]"
Build settings specific to the Debug configuration.
SettingsDictionary
default:"[:]"
Build settings specific to the Release configuration.
DefaultSettings
default:".recommended"
An enum specifying the set of default settings. See DefaultSettings section below.
String?
default:"nil"
The default configuration to be used when building from the command line.
Custom Configurations Settings
.settings(configurations:) Method
Creates settings with custom configurations.
SettingsDictionary
default:"[:]"
A dictionary with build settings inherited by all configurations.
[Configuration]
required
A list of custom configurations. Should not be empty - use the simpler method for default Debug/Release configurations.
DefaultSettings
default:".recommended"
An enum specifying the set of default settings.
String?
default:"nil"
The default configuration to be used when building from the command line.
Configuration
Represents a build configuration (Debug or Release variant).Debug Configuration
ConfigurationName
required
The name of the configuration to use.
SettingsDictionary
default:"[:]"
The build settings to apply for this configuration.
Path?
default:"nil"
The xcconfig file to associate with this configuration.
Release Configuration
SettingValue
Represents a build setting value, which can be a string, array of strings, or boolean.String Value
Array Value
Boolean Value
From RawRepresentable
DefaultSettings
Specifies the default set of settings applied to projects and targets..recommended
.recommended(excluding:)
.essential
PRODUCT_NAME, TARGETED_DEVICE_FAMILY).
.essential(excluding:)
.none
Examples
Project-Level Settings
Target-Level Settings
Multiple Environments
Setting Resolution Order
Build settings are resolved in this order (later overrides earlier):- Tuist’s default settings (if
.recommendedor.essential) - Project base settings
- Project configuration settings
- Project xcconfig file
- Target base settings
- Target configuration settings
- Target xcconfig file