Chapter 9. Life Cycle of a Project
This chapter surveys some of the main stages in the life cycle of an Xcode project, from inception to submission at the App Store. The survey will provide an opportunity to discuss some additional features of the Xcode development environment as well as various tasks you’ll typically perform as you work on your app, including editing, debugging, and testing your code, running your app on a device, profiling, localization, and releasing to the public.
Environmental Dependencies
It may be useful to have your app behave differently depending on the environment in which it finds itself when compiling or running:
- Compile-time dependencies
-
These are choices made at compilation time; the compiler can substitute different code, depending on the target environment while building. Typical dependencies are:
-
The version of Swift under which we’re compiling.
-
The type of destination for which we’re compiling — a simulator or a real device.
-
A custom compilation condition defined for the current build configuration in the build settings.
-
- Runtime dependencies
-
These are choices made depending on what the app discovers its environment to be when it runs. Typical dependencies are the type of device we turn out to be running on (iPad vs. iPhone) and the system version installed on this device:
-
Should the app be permitted to run under this environment?
-
Should the app do different things, or load different resources, depending on the environment?
-
Get iOS 13 Programming Fundamentals with Swift now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.