Chapter 3. Applications on OS X and iOS

As far as users are concerned, applications are the only thing on their computers besides their files. After all, a computer is defined by what it can do for the user, and what it can do is defined by the applications that are installed.

As a developer, it’s easy to get drawn into the details of how an app is put together—the individual classes, methods, and structures. However, the application as a whole is what’s sold to the user, and that’s all users care about.

In this chapter, you’ll learn how applications are structured on OS X and iOS, how they differ from other kinds of distributable code, what they can do on the system, and what they’re prevented from doing by the built-in security measures provided by the OS.

What Is an Application?

Applications on iOS and OS X are packaged differently from applications on other platforms, most notably Windows. On other platforms, the end result of compiling your project is a binary file that contains the compiled code. It’s then up to you as a developer to package that binary file up with the resources it needs. On Linux, you generate a package file (which can vary depending on the distribution you’re using), and on Windows, it’s traditional to create an “installer,” which is an additional application that unpacks the binary and resources.

OS X and iOS take a different approach to applications. This approach stems from the concept of a “package”—a folder that contains a number of items but is presented ...

Get Swift Development with Cocoa now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.