Xcode Configurations and Flags

preview_player
Показать описание
In this video, I am going to introduce you to Xcode configuration files, flags, compiler directives and accessing Build settings from code in Swift. It is not as complicated as you may think, and it has some extremely practical applications.

If you want to support my work, you can buy me a coffee :)

******** Download my StewartLynch YouTube Channel Application - Free ***********

Table of Contents:
0:00 Introduction
2:48 Schemes
4:40 DEBUG Compiler flag
6:20 Custom Configurations
7:00 Configuration Flags
10:44 Configuration Files
13:14 Configuration File Key value pairs
16:15 Accessing Build settings in code

Starter Project Files:

Completed Project:

References mentioned in video:
Apple Doc
AppCoda
Heartbeat
Ted Bendixson
NSHipster

Other References:
Stewart Lynch's YouTube Channel:
Stewart Lynch on Twitter:
Рекомендации по теме
Комментарии
Автор

Stewart, thanks for covering topics that no other iOS YouTuber is covering!

williamallen
Автор

Thank you so much for this; no one ever talks about this stuff…

ZoeSummersA
Автор

Thank you Stewart. A very useful video. Xcode configuration, and the many options available are intimidating.
So this video is a great introduction and place to start. More please.

larschristiansen
Автор

Simply a fantastic presentation that has demystified this and has given me greater Xcode powers! Thank you Stewart.

Note: with Xcode 14.2, I found that the custom configuration/flag DEVELOPMENT can be added anywhere within the #if, #elseif, #endif sequence--meaning before or after the default RELEASE and DEBUG flags. In the video you note to place the custom ones before these defaults. Works just fine in any order.

GaryLutchansky
Автор

Thank you for this video, it's been a great pleasure to learn this from your Channel. Subscribed!. And btw, you have a great voice, you explain so well and go straight. to the point, Thank you!.

gabrieljaramillo
Автор

Great content so far explaining custom flags! You are true gem Stewart! Thank you

dhavalnena
Автор

Wonderful video and very educational indeed. Thank you very much!

alobaili
Автор

you have a talent to teach! thank you!

evgeshaky
Автор

Exactly what I needed to fix a bug at work

ios_interview
Автор

Thx for the video. ---- Before running the project to see the expected behavior, we need to change "Build Configuration" as debug, release or development. Instead, I prefer to create three schemas for each configuration; such as "Debug", "Release", "Development" and then assign needed configuration to each of them. I would be able to use the required configuration by simply selecting the schema from the schemas-dropdown at the top of the Xcode editor.

gokhanmutlu
Автор

It would be nice to see this being used in a multi-module app, does it work the same for a module? Are values only accessible inside the actual module or do we have to expose them in the main project for the workspace?

alejandroivan
Автор

I like this video as I have not done these things in iOS with Swift before, how would I add one target for each platform? I have the following folders: macOS Vapor, macOS AppKit, macOS ncurses, iOS for iPhone, iOS for iPad, tvOS. While the implementation for all of them are in a folder named common. I would also like to be able to add linux amd64 Vapor, and linux amd64 ncurses.

gjermundification
Автор

I am surprised you can say #if instead of #ifdef.

JuliusSmith
Автор

Again, top notch! Thank you so much
Also I have a cool trick if you want to include the https:// is to write it that way https:/$()/

mohamedfawzi
Автор

Sorry Sir, GitHubLink doesn't work

starseedgamma