O'Reilly logo

Cocoa Programming for OS X: The Big Nerd Ranch Guide by Aaron Hillegass, Adam Preble, Nate Chandler

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Preprocessor Directives: Using Build Configurations to Change Behavior

One common use of build configurations is to hardcode behavioral settings in your application. This is done using preprocessor directives.

In Xcode, select the project in the project navigator to bring up the project editor. In the project editor, select the RanchForecastSplit target and switch to the Build Settings tab. Scroll nearly to the bottom until you find the Swift Compiler - Custom Flags heading, where you will see the Other Swift Flags field (Figure 36.3).

Figure 36.3  Other Swift flags

Other Swift flags

Expand that field, using the disclosure arrow on the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required