Chapter 10. 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. This 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, localizing, 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:

Buildtime dependencies

These are choices made at build time. They affect the build process, including what the compiler does. 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.

  • The action that causes the build — for instance, whether we’re building to run or to archive.

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 ...

Get iOS 15 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.