Generally, the system libraries and frameworks of iOS that ultimately support UIKit are a subset of the libraries
and frameworks in Mac OS X. For example, there is no Carbon application environment in iOS, there is no
command-line access (the BSD environment in Darwin), there are no printing frameworks and services, and
QuickTime is absent from the platform. However, because of the nature of the devices supported by iOS,
there are some frameworks, both public and private, that are specific to iOS.
The following summarizes some of the frameworks found at each layer of the iOS stack, starting from the
foundation layer.
● Core OS. This level contains the kernel, the file system, networking infrastructure, security, power
management, and a number of device drivers. It also has the libSystem library, which supports the
POSIX/BSD 4.4/C99 API specifications and includes system-level APIs for many services.
● Core Services. The frameworks in this layer provide core services, such as string manipulation, collection
management, networking, URL utilities, contact management, and preferences. They also provide services
based on hardware features of a device, such as the GPS, compass, accelerometer, and gyroscope.
Examples of frameworks in this layer are Core Location, Core Motion, and System Configuration.
This layer includes both Foundation and Core Foundation, frameworks that provide abstractions for
common data types such as strings and collections. The Core Frameworks layer also contains Core Data,
a framework for object graph management and object persistence.
● Media. The frameworks and services in this layer depend on the Core Services layer and provide graphical
and multimedia services to the Cocoa Touch layer. They include Core Graphics, Core Text, OpenGL ES,
Core Animation, AVFoundation, Core Audio, and video playback.
● Cocoa Touch. The frameworks in this layer directly support applications based in iOS. They include
frameworks such as Game Kit, Map Kit, and iAd.
The Cocoa Touch layer and the Core Services layer each has an Objective-C framework that is especially
important for developing applications for iOS. These are the core Cocoa frameworks in iOS:
● UIKit. This framework provides the objects an application displays in its user interface and defines the
structure for application behavior, including event handling and drawing. For a description of UIKit, see
“UIKit (iOS)” (page 44).
● Foundation. This framework defines the basic behavior of objects, establishes mechanisms for their
management, and provides objects for primitive data types, collections, and operating-system services.
Foundation is essentially an object-oriented version of the Core Foundation framework; see
“Foundation” (page 30) for a discussion of the Foundation framework.
Notes: This document uses “Cocoa” generically when referring to things that are common between the
platforms. When it is necessary to say something specific about Cocoa on a given platform, it uses a phrase
such as “Cocoa in Mac OS X.”
As with Cocoa in Mac OS X, the programmatic interfaces of Cocoa in iOS give your applications access to the
capabilities of underlying technologies. Usually there is a Foundation or UIKit method or function that can
tap into a lower-level framework to do what you want. But, as with Cocoa in Mac OS X, if you require some
capability that is not exposed through a Cocoa API, or if you need some finer control of what happens in
your application, you may choose to use an underlying framework directly. For example, UIKit uses the WebKit
to draw text and publishes some methods for drawing text; however, you may decide to use Core Text to
The Cocoa Environment 17
2010-12-13 | © 2010 Apple Inc. All Rights Reserved.
CHAPTER 1
What Is Cocoa?