Vous êtes sur la page 1sur 38

What's New in iPhone OS

General

2010-04-30
Java and all Java-based trademarks are
Apple Inc. trademarks or registered trademarks of Sun
© 2010 Apple Inc. Microsystems, Inc. in the U.S. and other
All rights reserved. countries.
OpenGL is a registered trademark of Silicon
No part of this publication may be reproduced, Graphics, Inc.
stored in a retrieval system, or transmitted, in
any form or by any means, mechanical, Simultaneously published in the United States
electronic, photocopying, recording, or and Canada.
otherwise, without prior written permission of Even though Apple has reviewed this document,
APPLE MAKES NO WARRANTY OR REPRESENTATION,
Apple Inc., with the following exceptions: Any EITHER EXPRESS OR IMPLIED, WITH RESPECT TO
person is hereby authorized to store THIS DOCUMENT, ITS QUALITY, ACCURACY,
documentation on a single computer for MERCHANTABILITY, OR FITNESS FOR A PARTICULAR
PURPOSE. AS A RESULT, THIS DOCUMENT IS
personal use only and to print copies of PROVIDED “AS IS,” AND YOU, THE READER, ARE
documentation for personal use provided that ASSUMING THE ENTIRE RISK AS TO ITS QUALITY
AND ACCURACY.
the documentation contains Apple’s copyright
IN NO EVENT WILL APPLE BE LIABLE FOR DIRECT,
notice. INDIRECT, SPECIAL, INCIDENTAL, OR
CONSEQUENTIAL DAMAGES RESULTING FROM ANY
The Apple logo is a trademark of Apple Inc. DEFECT OR INACCURACY IN THIS DOCUMENT, even
if advised of the possibility of such damages.
Use of the “keyboard” Apple logo
(Option-Shift-K) for commercial purposes THE WARRANTY AND REMEDIES SET FORTH ABOVE
ARE EXCLUSIVE AND IN LIEU OF ALL OTHERS, ORAL
without the prior written consent of Apple may OR WRITTEN, EXPRESS OR IMPLIED. No Apple
constitute trademark infringement and unfair dealer, agent, or employee is authorized to make
any modification, extension, or addition to this
competition in violation of federal and state warranty.
laws. Some states do not allow the exclusion or limitation
of implied warranties or liability for incidental or
No licenses, express or implied, are granted consequential damages, so the above limitation or
with respect to any of the technology described exclusion may not apply to you. This warranty gives
in this document. Apple retains all intellectual you specific legal rights, and you may also have
other rights which vary from state to state.
property rights associated with the technology
described in this document. This document is
intended to assist application developers to
develop applications only for Apple-labeled
computers.
Every effort has been made to ensure that the
information in this document is accurate. Apple
is not responsible for typographical errors.
Apple Inc.
1 Infinite Loop
Cupertino, CA 95014
408-996-1010

App Store is a service mark of Apple Inc.


iTunes Store is a registered service mark of
Apple Inc.
Apple, the Apple logo, Bonjour, Instruments,
iPhone, iPod, iPod touch, iTunes, iWork,
Keychain, Mac, Mac OS, Macintosh, Objective-C,
Quartz, Safari, and Xcode are trademarks of
Apple Inc., registered in the United States and
other countries.
iPad is a trademark of Apple Inc.
Intel and Intel Core are registered trademarks
of Intel Corportation or its subsidiaries in the
United States and other countries.
Contents

Introduction 7

Organization of This Document 7


Getting the iPhone SDK 7

iPhone OS 4.0 9

Multitasking 9
Integration Technologies 10
Local Notifications 10
Event Kit 10
Data Protection 10
Core Telephony 11
iAd 11
Graphics and Multimedia 11
Quick Look Framework 11
AV Foundation 11
Assets Library 12
Image I/O 12
Core Media 12
Core Video 12
Core Services 13
Block Objects 13
Grand Central Dispatch 13
Accelerate Framework 13
Xcode Tools 14
Xcode Improvements 14
UI Automation API 14
Framework Enhancements 14
UIKit Framework Enhancements 14
Foundation Framework Enhancements 15
OpenGL ES Enhancements 16
Game Kit Enhancements 16
Core Location Enhancements 17
Map Kit Enhancements 17
Message UI Enhancements 17
Core Graphics Enhancements 17
ICU Enhancements 18
Inherited Improvements 18

3
2010-04-30 | © 2010 Apple Inc. All Rights Reserved.
iPhone OS 3.2 19

User Interface Changes 19


Popovers 19
Split Views 19
Custom Input Views 20
External Display Support 20
Gesture Recognizers 20
Improved Text Support 21
Core Text 21
Text Input Support 21
Custom Font Support 22
ICU Regular-Expression Support 22
File and Document Support 22
File-Sharing Support 22
Document Support 23
PDF Generation 23
Xcode Tools 23
API Changes 24
UIKit Framework Changes 24
Media Player Framework Changes 25
Core Animation Changes 25
MapKit Framework Changes 25
Foundation Framework Changes 25

iPhone OS 3.1 27

Video Editing Support 27


Core Animation Enhancements 27
Instruments 27

iPhone OS 3.0 29

Apple Push Notification Service 29


Cut, Copy, and Paste 29
Accessory Support 30
In App Purchase Support 30
Peer to Peer Support 30
Maps API 31
iPod Library Access 31
Audio Recording and Management 31
Core Data 32
In App Email 32
Streaming Video 32
Safari Features 33
Shared Keychain Items 33

4
2010-04-30 | © 2010 Apple Inc. All Rights Reserved.
Accessibility Support 33
Compass Support 34
OpenGL ES 2.0 34
Additional Enhancements 34
UIKit Framework Enhancements 34
Foundation Framework Enhancements 35
Core Audio Enhancements 35
API Changes 36

Document Revision History 37

5
2010-04-30 | © 2010 Apple Inc. All Rights Reserved.
6
2010-04-30 | © 2010 Apple Inc. All Rights Reserved.
Introduction

Important: This is a preliminary document for an API or technology in development. Although this document
has been reviewed for technical accuracy, it is not final. Apple is supplying this information to help you plan
for the adoption of the technologies and programming interfaces described herein. This information is subject
to change, and software implemented according to this document should be tested with final operating
system software and final documentation. Newer versions of this document may be provided with future
seeds of the API or technology.

This document provides information about features that were introduced in different versions of iPhone OS
and that affect the development of iPhone applications. This document describes only features that affect
the development of iPhone applications. It does not include user-level features unless there is an aspect of
the feature that affects application development.

In addition to describing the new features for each iPhone OS release, this document attempts to provide
insight as to how and when you might use those features in your own software. Wherever possible, this
document also provides links to other Apple conceptual and reference documentation for that feature. For
a complete list of features you can use in your iPhone applications, see iPhone OS Technology Overview.

Organization of This Document

This document includes the following articles:

■ “iPhone OS 4.0” (page 9) describes the new and updated features in iPhone OS 4.0.
■ “iPhone OS 3.2” (page 19) describes the new and updated features in iPhone OS 3.2.
■ “iPhone OS 3.1” (page 27) describes the new and updated features in iPhone OS 3.1.
■ “iPhone OS 3.0” (page 29) describes the new and updated features in iPhone OS 3.0.

Getting the iPhone SDK

Development of iPhone applications requires an Intel-based Macintosh computer running Mac OS X v10.5
or later. You must also download and install the iPhone SDK. For information about how to get the iPhone
SDK, go to http://developer.apple.com/iphone/.

Organization of This Document 7


2010-04-30 | © 2010 Apple Inc. All Rights Reserved.
Introduction

8 Getting the iPhone SDK


2010-04-30 | © 2010 Apple Inc. All Rights Reserved.
iPhone OS 4.0

This article summarizes the developer-related features introduced in iPhone OS 4.0. This version of the
operating system runs on iPhone and iPod touch only and does not run on iPad. In addition to describing
the new features, this article lists the documents that describe those features in more detail.

Note: iPhone OS 4.0 does not support iPad. It runs only on iPhone and iPod touch devices.

For the latest updates and information, you should also see iPhone OS 4.0 Release Notes. For the list of API
differences between the iPhone OS 4.0 and earlier versions of iPhone OS, see iPhone OS 4.0 API Diffs.

Multitasking

Applications built using iPhone SDK 4.0 or later (and running in iPhone OS 4.0 and later) are no longer
terminated when the user presses the Home button; instead, they now shift to a background execution
context. For many applications, this means that the application enters a suspended state of execution shortly
after entering the background. Keeping the application in memory avoids the subsequent launch cycle and
allows an application to simply reactivate itself, which improves the overall user experience. And suspending
the application improves overall system performance by minimizing power usage and giving more execution
time to the foreground application.

Although most applications are suspended shortly after moving to the background, applications that need
to continue working in the background may do so using one of the following techniques:

■ An application can request a finite amount of time to complete some important task.
■ An application can declare itself as supporting specific services that require regular background execution
time.
■ An application can use local notifications to generate user alerts at designated times, whether or not
the application is running.

Regardless of whether your application is suspended or continues running in the background, supporting
multitasking does require some additional work on your part. Background applications can still be terminated
under certain conditions (such as during low-memory conditions), and so applications must be ready to exit
at any time. This means that many of the tasks you used to perform at quit time must now be performed
when your application moves to the background. This requires implementing some new methods in your
application delegate to respond to application state transitions.

For more information on how to handle the new background state transitions, and for information on how
to continue running in the background, see iPhone Application Programming Guide.

Multitasking 9
2010-04-30 | © 2010 Apple Inc. All Rights Reserved.
iPhone OS 4.0

Integration Technologies

The following sections describe the technologies you can use to enhance your application’s user experience.

Local Notifications
Local notifications complement the existing push notifications by giving applications an avenue for generating
the notifications locally instead of relying on an external server. Background applications can use local
notifications as a way to get a user’s attention when important events happen. For example, a navigation
application running in the background can use local notifications to alert the user when it is time to make a
turn. Applications can also schedule the delivery of local notifications for a future date and time and have
those notifications delivered even if the application is not running.

The advantage of local notifications is that they are independent of your application. Once a notification is
scheduled, the system manages the delivery of it. Your application does not even have to be running when
the notification is delivered.

For more information about using local notifications, see Local and Push Notification Programming Guide.

Event Kit
The Event Kit framework (EventKit.framework) provides an interface for accessing calendar events on a
user’s device. You can use this framework to get existing events and add new events to the user’s calendar.
Calendar events can include alarms that you can configure with rules for when they should be delivered. In
addition to using Event Kit for creating new events, you can use the view controllers of the Event Kit UI
framework (EventKitUI.framework) to present standard system interfaces for viewing and editing events.

For more information about the classes and methods of these frameworks, see Event Kit Framework Reference
and Event Kit UI Framework Reference.

Data Protection
Applications that work with sensitive user data can now take advantage of the built-in encryption available
on some devices to protect that data. When your application designates a particular file as protected, the
system stores that file on-disk in an encrypted format. While the device is locked, the contents of the file are
inaccessible to both your application and to any potential intruders. However, when the device is unlocked
by the user, a decryption key is created to allow your application to access the file.

Implementing data protection requires you to be considerate in how you create and manage the data you
want to protect. Applications must themselves be designed to secure the data at creation time and to be
prepared for changes in access to that data when the user locks and unlocks the device.

For more information about how to add data protection to the files of your application, see “Implementing
Standard Application Behaviors” in iPhone Application Programming Guide.

10 Integration Technologies
2010-04-30 | © 2010 Apple Inc. All Rights Reserved.
iPhone OS 4.0

Core Telephony
The Core Telephony framework (CoreTelephony.framework) provides interfaces for interacting with
phone-based information on devices that have a cellular radio. Applications can use this framework to get
information about a user’s cellular service provider. Applications interested in cellular call events can also be
notified when those events occur.

For more information about using the classes and methods of this framework, see Core Telephony Framework
Reference.

iAd
You can use iAd (iAd.framework) to deliver banner-based advertisements from your application.
Advertisements are incorporated into standard views that you integrate into your user interface and present
when you want. The views themselves work with Apple’s ad service to automatically handle all the work
associated with loading and presenting the ad content and responding to taps in those ads.

For more information about using iAd in your applications, see iAd Framework Reference.

Graphics and Multimedia

The following sections describe the new graphics and media-related technologies you can incorporate into
your applications.

Quick Look Framework


The Quick Look framework (QuickLook.framework) provides a direct interface for previewing the contents
of files your application does not support directly. This framework is intended primarily for applications that
download files from the network or that otherwise work with files from unknown sources. After obtaining
the file, you use the view controller provided by this framework to display the contents of that file directly
in your user interface.

For more information about the classes and methods of this framework, see Quick Look Framework Reference.

AV Foundation
The AV Foundation framework (AVFoundation.framework) is for applications that need to go beyond the
music and movie playback features found in the Media Player framework. Originally introduced in iPhone
OS 3.0, this framework has been expanded in iPhone OS 4.0 to include significant new capabilities, substantially
broadening its usage beyond basic audio playback and recording capabilities. Specifically, this framework
now includes support for the following features:

■ Media asset management


■ Media editing
■ Movie capture

Graphics and Multimedia 11


2010-04-30 | © 2010 Apple Inc. All Rights Reserved.
iPhone OS 4.0

■ Movie playback
■ Track management
■ Metadata management for media items
■ Stereophonic panning
■ Precise synchronization between sounds
■ An Objective-C interface for determining details about sound files, such as the data format, sample rate,
and number of channels

The AV Foundation framework is a single source for recording and playing back audio and video in iPhone
OS. This framework also provides much more sophisticated support for handling and managing media items.

For more information about the classes and methods of the AV Foundation framework, see AV Foundation
Framework Reference.

Assets Library
The Assets Library framework (AssetsLibrary.framework) provides a query-based interface for retrieving
a user’s photos and videos. Using this framework, you can access the same assets that are nominally managed
by the Photos application, including items in the user’s saved photos album and any photos and videos that
were imported onto the device. You can also save new photos and videos back to the user’s saved photos
album.

For more information about the classes and methods of this framework, see Assets Library Framework Reference.

Image I/O
The Image I/O framework (ImageIO.framework) provides interfaces for importing and exporting image
data and image metadata. This framework is built on top of the Core Graphics data types and functions and
supports all of the standard image types available in iPhone OS.

For more information about the functions and data types of this framework, see Image I/O Reference Collection.

Core Media
The Core Media framework (CoreMedia.framework) provides the low-level media types used by AV
Foundation. Most applications should never need to use this framework, but it is provided for those few
developers who need more precise control over the creation and presentation of audio and video content.

For more information about the functions and data types of this framework, see Core Media Framework
Reference.

Core Video
The Core Video framework (CoreVideo.framework) provides buffer and buffer pool support for Core Media.
Most applications should never need to use this framework directly.

12 Graphics and Multimedia


2010-04-30 | © 2010 Apple Inc. All Rights Reserved.
iPhone OS 4.0

Core Services

The following sections describe the new lower-level technologies and features you can incorporate into your
applications.

Block Objects
Block objects are a C-level language construct that you can incorporate into your C, C++, and Objective-C
code. A block object is a mechanism for creating an ad hoc function body, something which in other languages
is sometimes called a closure or lambda. You use block objects in places where you need to create a reusable
segment of code but where creating a function or method might be too heavyweight or inflexible.

In iPhone OS, blocks are commonly used in the following scenarios:

■ As a replacement for delegates and delegate methods


■ As a replacement for callback functions
■ To implement completion handlers for one-time operations
■ To facilitate performing a task on all the items in a collection
■ Together with dispatch queues, to perform asynchronous tasks

For an introduction to block objects and how you use them, see A Short Practical Guide to Blocks. For more
information about blocks, see Blocks Programming Topics.

Grand Central Dispatch


Grand Central Dispatch (GCD) is a BSD-level technology that you use to manage the execution of tasks in
your application. GCD combines an asynchronous programming model with a highly optimized core to
provide a convenient (and more efficient) alternative to threading. GCD also provides convenient alternatives
for many types of low-level tasks, such as reading and writing file descriptors, implementing timers, monitoring
signals and process events, and more.

For more information about how to use GCD in your applications, see Concurrency Programming Guide. For
information about specific GCD functions, see Grand Central Dispatch (GCD) Reference.

Accelerate Framework
The Accelerate framework (Accelerate.framework) contains interfaces for performing math, big-number,
and DSP calculations, among others. The advantage of using this framework over writing your own versions
of these libraries is that it is optimized for the different hardware configurations present in iPhone OS–based
devices. Therefore, you can write your code once and be assured that it runs efficiently on all devices.

For more information about the functions of the Accelerate framework, see Accelerate Framework Reference.

Core Services 13
2010-04-30 | © 2010 Apple Inc. All Rights Reserved.
iPhone OS 4.0

Xcode Tools

The following sections describe the improvements to the Xcode tools and the support for developing iPhone
OS applications.

Xcode Improvements
Xcode 3.2.3 introduces automatic device and provisioning-profile management in the Organizer window.
With automatic device provisioning enabled, you can install applications on your device for debugging and
testing without having to log in to your team portal to register the device and download a provisioning
profile

Note: You still need to log in to your team portal to create provisioning profiles with specific application IDs
for in-app purchase and push notifications. However, once created, those provisioning profiles will also be
managed by Xcode if automatic device provisioning is enabled.

For more information about using Xcode, see iPhone Development Guide.

UI Automation API
The Instruments application now provides support for automating the testing of your iPhone OS applications.
The built-in Automation instrument works from scripts (written in JavaScript) that you provide to drive the
simulation of events in your application. These synthetic events are generated with the help of the accessibility
interfaces built into iPhone OS and integrated into all existing UIKit views. You can use this instrument to
improve your testing process and deliver more robust applications.

For information about how to use the Automation instrument, see Instruments User Guide. For information
about the JavaScript objects and commands you use in your scripts, see UI Automation Reference Collection.

Framework Enhancements

The following existing frameworks and technologies include additional incremental changes. For a complete
list of new interfaces, see iPhone OS 4.0 API Diffs.

UIKit Framework Enhancements


The UIKit framework includes the following enhancements:

■ The UIApplication class and UIApplicationDelegate protocol include new methods for scheduling
local notifications and for supporting multitasking.
■ Drawing to a graphics context in UIKit is now thread-safe. Specifically:

14 Xcode Tools
2010-04-30 | © 2010 Apple Inc. All Rights Reserved.
iPhone OS 4.0

❏ The routines used to access and manipulate the graphics context can now correctly handle contexts
residing on different threads.
❏ String and image drawing is now thread-safe.
❏ Using color and font objects in multiple threads is now safe to do.

■ The UIImagePickerController class includes methods for programmatically starting and stopping
video capture.
■ The UILocalNotification class supports the configuration of local notifications; see “Local
Notifications” (page 10).
■ The UIView class includes new block-based methods for implementing animations.
■ The UIWindow class has a new rootViewController property that you can use to change the contents
of the window.
■ Media applications can now receive events related to the controls on an attached set of headphones.
You can use these events to control the playback of media-related items.
■ Several new accessibility interfaces help you make some UI elements more accessible and allow you to
customize your application experience specifically for VoiceOver users:
❏ The UIAccessibilityAction protocol makes it easy for VoiceOver users to adjust the value of
UI elements, such as pickers and sliders.
❏ UIPickerViewAccessibilityDelegate protocol enables access to the individual components
of a picker.
❏ UIAccessibilityFocus protocol allows you to find out when VoiceOver is focused on an element,
so you can help users avoid making unnecessary taps.
❏ The UIAccessibilityTraitStartsMediaSession trait allows you to prevent VoiceOver from
speaking during a media session that should not be interrupted.
❏ New interfaces in UIAccessibility protocol allow you to specify the language in which labels
and hints are spoken, and provide announcements that describe events that don't update application
UI in way that would be perceptible to VoiceOver users.

■ The UINib class provides a way to instantiate multiple sets of objects efficiently from the same nib file.

For information about the classes of the UIKit framework, see UIKit Framework Reference.

Foundation Framework Enhancements


The Foundation framework includes the following enhancements:

■ Most delegate methods are now declared in formal protocols instead of as categories on NSObject.
■ Block-based variants are now available for many types of operations.
■ There is new support for creating and formatting date information in NSDate and NSDateFormatter.
■ The NSDateComponents class added support for specifying time zone and quarter information.
■ There is support for regular-expression matching using the NSRegularExpression, NSDataDetector,
and NSTextCheckingResult classes.

Framework Enhancements 15
2010-04-30 | © 2010 Apple Inc. All Rights Reserved.
iPhone OS 4.0

■ The NSBlockOperation class allows you to add blocks to operation queues.


■ You can use the NSFileManager class to mark files as protected; see “Data Protection” (page 10).
■ The NSFileWrapper class allows you to work with package-based document types.
■ The NSOrthography class describes the linguistic content of a piece of text.
■ The NSCache class provides support for storing and managing temporary data.
■ The URL-related classes have been updated so that you can now pipeline URL requests and set request
priorities.

For information about the classes of the Foundation framework, see Foundation Framework Reference.

OpenGL ES Enhancements
The OpenGL ES framework includes the following enhancements:

■ The APPLE_framebuffer_multisample extension enables full-scene anti-aliasing.


■ The EXT_framebuffer_discard extension can be used to improve the performance of applications
that use depth buffers or multisample framebuffers.
■ The APPLE_texture_max_level and EXT_shader_texture_lod extensions provide more control
over texture sampling.
■ The OES_vertex_array_object (http://www.khronos.org/registry/gles/extensions/OES/OES_vertex_ar-
ray_object.txt) API allows caching of vertex array state, to decrease driver overhead.
■ The OES_depth_texture extension enables rendering real-time shadows using shadow maps.
■ The OES_texture_float (http://www.khronos.org/registry/gles/extensions/OES/OES_texture_float.txt)
and OES_texture_half_float (http://www.khronos.org/registry/gles/extensions/OES/OES_tex-
ture_float.txt) extensions adds texture formats with floating point components to enable High Dynamic
Range rendering.
■ The APPLE_rgb_422 (http://www.opengl.org/registry/specs/APPLE/rgb_422.txt) extension enables
texturing from some common video formats.
■ Performance of texture creation and modification has been significantly improved.
■ Driver performance has been generally improved.

Game Kit Enhancements


The Game Kit framework includes a beta implementation of a centralized service called Game Center. This
service provides game developers with a standard way to implement the following features:

■ Aliases allow users to create their own online persona. Users log in to Game Center and interact with
other players anonymously through their alias. Players can set status messages as well as mark specific
people as their friends.
■ Leader boards allow your application to post scores to Game Center and retrieve them later.
■ Matchmaking allows players to connect with other players with Game Center accounts.

16 Framework Enhancements
2010-04-30 | © 2010 Apple Inc. All Rights Reserved.
iPhone OS 4.0

Important: GameCenter is available to developers only in iPhoneOS 4.0. It is introduced as a developer-only


feature so that you can provide feedback as you implement and test Game Center features in your applications.
However, Game Center is not a user feature in iPhone OS 4.0 and you should not deploy applications that
use it to the App Store.

For information about the classes of the Game Kit framework, see Game Kit Framework Reference.

Core Location Enhancements


The Core Location framework now includes a new location monitoring service that offers a lower-power
alternative for determining the user’s location.

For information about the classes of the Core Location framework, see Core Location Framework Reference.

Map Kit Enhancements


The Map Kit framework includes the following enhancements:

■ Support for draggable map annotations


■ Support for map overlays

Draggable map annotations make it much easier to reposition those annotations after they have been added
to a map. The Map Kit framework handles most of the touch events associated with initiating, tracking, and
ending a drag operation. However, the annotation view must work in conjunction with the map view delegate
to ensure that dragging of the annotation view is supported.

Map overlays provide a way to create more complex types of annotations. Instead of being pinned to a single
point, an overlay can represent a path or shape that spans a wider region. You can use overlays to layer
information such as bus routes, election maps, park boundaries, and weather maps on top of the map.

For information about the functions and types of the Map Kit framework, see Map Kit Framework Reference.

Message UI Enhancements
The Message UI framework includes a new MFMessageComposeViewController class for composing SMS
messages. This class manages a standard system interface for composing and sending SMS messages. In
contrast with sending SMS messages using a specially formatted URL, this class allows you to create and
send the message entirely from within your application.

For more information about the classes of the Message UI framework, see Message UI Framework Reference.

Core Graphics Enhancements


The Core Graphics framework includes the following enhancements:

■ The ability to embed metadata into PDF files using the CGPDFContextAddDocumentMetadata function

Framework Enhancements 17
2010-04-30 | © 2010 Apple Inc. All Rights Reserved.
iPhone OS 4.0

■ Support for creating color spaces using an ICC profile


■ Graphics context support for font smoothing and fine-grained pixel manipulation

For information about the functions and types of the Core Graphics framework, see Core Graphics Framework
Reference.

ICU Enhancements
The International Components for Unicode (ICU) libraries were updated to version 4.4. ICU is an open-source
project for Unicode support and software internationalization. The installed version of ICU includes only a
subset of the header files that are part of the broader ICU library. Specifically, iPhone OS includes only the
headers used to support regular expressions.

For more information about using the functions of the ICU 4.4 library, see the documentation at http://site.icu-
project.org/.

Inherited Improvements

Although iPhone OS 3.2 does not run on iPhone and iPod touch devices, many of the features introduced in
that version of the operating system are also supported in iPhone OS 4.0. Specifically, iPhone OS 4.0 supports:

■ Custom input views


■ Connecting external displays
■ File-sharing support
■ Gesture recognizers
■ Core Text for text layout and rendering
■ Text input through integration with the keyboard
■ Custom fonts
■ ICU Regular Expressions
■ Document types
■ PDF generation
■ Xcode Tools changes
■ UIKit framework changes
■ Media Player framework changes
■ Core Animation changes
■ Foundation framework changes

What is not supported are new controls and classes designed specifically for iPad. For more information
about these features, see their descriptions in “iPhone OS 3.2” (page 19).

18 Inherited Improvements
2010-04-30 | © 2010 Apple Inc. All Rights Reserved.
iPhone OS 3.2

This article summarizes the developer-related features introduced in iPhone OS 3.2. This version of the
operating system runs on iPad only and many of the corresponding features were designed specifically for
that device. In addition to describing the features, this article lists the documents that describe those features
in more detail.

Note: iPhone OS 3.2 does not support iPhone and iPod touch devices. It runs only on iPad.

For the latest updates and information, you should also see iPhone SDK Release Notes for iPhone OS 3.2. For
the list of differences between iPhone OS 3.2 and earlier versions of iPhone OS, see iPhone OS 3.2 API Diffs.

User Interface Changes

Applications running on iPad have several new options for presenting content and receiving input from the
user. For information and guidelines about how to use these new features, be sure to consult iPad Human
Interface Guidelines.

Popovers
Popovers are floating views that reside above your application’s window and help you organize the contents
of your user interface. Popovers help to eliminate the clutter that might occur in applications that need to
display important controls or information in an unobtrusive way that does not distract from the main content.

The benefit of using a popover is that:

■ It appears only in response to specific user interactions and is dismissed automatically when the user
taps outside of its bounds. This behavior makes the popover less obtrusive to the user.
■ It typically covers only a small portion of the screen and so does not obscure as much of the underlying
content as a modal view might.

For more information about using popovers in your application, see “Views and View Controllers” in iPad
Programming Guide.

Split Views
The UISplitViewController class is a new container view controller that you use to manage two
side-by-side content views. These content views are typically used to create a master-detail interface, whereby
selecting an item in one view causes the other view to display detailed information about the selection. The
views themselves are managed by view controllers that you provide.

User Interface Changes 19


2010-04-30 | © 2010 Apple Inc. All Rights Reserved.
iPhone OS 3.2

The split view controller coordinates any interactions between your view controllers and the system. For
example, when the user rotates the device, the split view controller rotates both view controllers together,
forwarding any needed notifications to both of them.

For more information about split views, including how to use them in your applications, see “Views and View
Controllers” in iPad Programming Guide.

Custom Input Views


Instances of the UIResponder class now support the ability to display custom input and accessory views
when they become the first responder. Now, you can provide input views for any of your custom views and
have them presented automatically by the system. (Previously, the keyboard was the only supported input
view, and it was supported only by text view and text field objects.)

In addition to input views, you can also provide a custom accessory view to display above the input view.
Accessory views are commonly used to provide additional buttons and controls when the keyboard is
displayed. The explicit support now provided by responder objects makes it easy to animate your accessory
views into position.

For more information about how to configure and use custom input and accessory views, see “Custom Text
Processing and Input” in iPad Programming Guide and the UIResponder Class Reference.

External Display Support


An iPad can be connected to an external display through a set of supported cables. When connected, the
associated screen can be used by the application to display content. Information about the screen, including
its supported resolutions, is accessible through the interfaces of the UIKit framework. You also use that
framework to associate your application’s windows with one screen or another.

■ The UIScreen class provides support for retrieving screen objects for all available screens (including
the device’s main screen). Each screen object contains information about the properties of the screen
itself, including the dimensions that correctly take into account the size and pixel aspect ratio of the
screen.
■ The UIScreenMode class provides information about one particular size and pixel aspect ratio setting
of a screen.
■ Windows (represented by the UIWindow class) can now be assigned to a specific screen.

For more information about the support offered by these classes, see the individual class descriptions in UIKit
Framework Reference.

Gesture Recognizers
Gesture recognizers are objects that you attach to views and use to detect common types of gestures. After
attaching it to your view, you tell it what action you want performed when the gesture occurs. The gesture
recognizer object then tracks the raw events and applies the system-defined heuristics for what the given
gesture should be. Prior to gesture recognizers, the process for detecting a gesture involved tracking the
raw stream of touch events coming to your view and applying potentially complicated heuristics to determine
whether the events represented the given gesture.

20 User Interface Changes


2010-04-30 | © 2010 Apple Inc. All Rights Reserved.
iPhone OS 3.2

UIKit now includes a UIGestureRecognizer class that defines the basic behavior for all gesture recognizers.
You can define your own custom gesture recognizer subclasses or use one of the system-supplied subclasses
to handle any of the following standard gestures:

■ Tapping (any number of taps)


■ Pinching in and out (for zooming)
■ Panning or dragging
■ Swiping (in any direction)
■ Rotating (fingers moving in opposite directions)
■ Long presses

For more information about using gesture recognizers in your application, see “Gesture Recognizers” in iPad
Programming Guide.

Improved Text Support

In iPhone OS 3.2, there is significant new support for text input and rendering. This support is provided for
applications, such as word processors, that need more sophisticated text-handling capabilities.

Core Text
The Core Text framework (CoreText.framework) contains a set of simple, high-performance C-based
interfaces for laying out text and handling fonts. The Core Text framework provides a complete text layout
engine that you can use to manage the placement of text on the screen. The text you manage can also be
styled with different fonts and rendering attributes.

This framework is intended for use by applications that require sophisticated text handling capabilities, such
as word processing applications. If your application requires only simple text input and display, you should
continue to use the existing classes of the UIKit framework.

For more information about using the Core Text interfaces, see Core Text Programming Guide and Core Text
Reference Collection.

Text Input Support


The UIKit framework (UIKit.framework) includes new protocols that allow you to implement custom
text-input objects. If you are implementing an application that requires sophisticated text-handling capabilities,
you can use these protocols to implement new views and controls for receiving incoming text. Depending
on your needs, there are different protocols for receiving text input. Which protocols you use will depend
on the complexity of your user interface.

■ The UIKeyInput protocol lets you define simple objects (like text fields) that are capable of
character-by-character input.
■ The UITextInput protocol lets you define complex text views that support multiple lines of text,
selections, pasteboard operations, and more.

Improved Text Support 21


2010-04-30 | © 2010 Apple Inc. All Rights Reserved.
iPhone OS 3.2

For more information about how to use the text input support to implement your own custom objects, see
“Custom Text Processing and Input” in iPad Programming Guide.

Custom Font Support


Applications that want to use custom fonts can now include those fonts in their application bundle and
register those fonts with the system by including the UIAppFonts key in their Info.plist file. The value
of this key is an array of strings identifying the font files in the application’s bundle. When the system sees
the key, it loads the specified fonts and makes them available to the application.

For more information about the keys you can include in your application’s Info.plist file, see Information
Property List Key Reference.

ICU Regular-Expression Support


The BSD layer of iPhone OS now exposes a modified version of 4.2 of the International Components for
Unicode (ICU) libraries. ICU is an open-source project for Unicode support and software internationalization.
The installed version of ICU includes only those header files necessary to support regular expressions.

For more information about using the functions of the ICU 4.2 library, see the documentation and user guide
at http://icu-project.org/apiref/icu4c/index.html.

File and Document Support

In iPhone OS 3.2, there is new support for exchanging and opening files. This support makes it easier to
implement more document-centric applications, similar to what you might find on a desktop computer,
while still maintaining a simplified interface for your users.

File-Sharing Support
Applications that want to make user data files accessible can do so using application file sharing. File sharing
enables the application to expose the contents of its /Documents directory to the user through iTunes. The
user can then move files back and forth between the iPad and a desktop computer. This feature does not
allow your application to share files with other applications on the same device, though. To share data and
files between applications, you must use the pasteboard or a document interaction controller object.

To enable file sharing for your application, do the following:

1. Add the UIFileSharingEnabled key to your application’s Info.plist file and set the value of the
key to YES.

2. Put whatever files you want to share in your application’s Documents directory.

3. When the device is plugged into the user’s computer, iTunes 9.1 displays a File Sharing section in the
Apps tab of the selected device.

4. The user can add files to this directory or move files to the desktop.

22 File and Document Support


2010-04-30 | © 2010 Apple Inc. All Rights Reserved.
iPhone OS 3.2

Applications that support file sharing should be able to recognize when files have been added to the
Documents directory and respond appropriately. For example, your application might make the contents of
any new files available from its interface. You should never present the user with the list of files in this directory
and ask them to decide what to do with those files.

For additional information about the UIFileSharingEnabled key, see Information Property List Key Reference.

Document Support
An application can now register the file types it supports with the system and receive notifications when a
file of the given type needs to be opened. It does this by including the CFBundleDocumentTypes key in its
Info.plist file. An application that registers one or more file types may also be expected to open files of those
types at some point later. It does this by implementing the
application:didFinishLaunchingWithOptions: method in its application delegate and look for a file
in the UIApplicationLaunchOptionsURLKey key of the provided dictionary.

Complementing the ability to open files of known types is the addition of the
UIDocumentInteractionController class in the UIKit framework. This class provides a user-based
interaction model for managing files that your application does not know how to open. The document
interaction controller provides options for previewing the contents of a file in place or opening it in another
application. Document interaction controllers are particularly useful for email applications or applications
that may download files from the network.

For more information about supporting documents, see “The Core Application Design” in iPad Programming
Guide.

PDF Generation
The UIKit framework (UIKit.framework) includes new functions for generating PDF files and data objects
from your application’s custom content. You can use this support to generate PDF-based content for use
within your application or for storing to the local disk. The UIKit functions manage the setup and pagination
for the PDF data. You provide the actual content using the same native platform graphics technologies (UIKit,
Core Graphics, Core Text, and so on) already available for drawing to the screen. (You cannot draw to a PDF
context directly using OpenGL commands. However, you can transfer the pixels of your rendered content
to a CGImageRef data type and draw that.)

For more information about how to use the new UIKit functions to create PDF content, see “Graphics and
Drawing” in iPad Programming Guide.

Xcode Tools

Xcode includes new features to make developing applications that run on iPad much simpler, including the
following:

Xcode Tools 23
2010-04-30 | © 2010 Apple Inc. All Rights Reserved.
iPhone OS 3.2

■ Xcode simplifies the process of sharing code between your iPhone and iPad applications by helping you
update your existing iPhone projects to include the necessary files to support iPad. The Transition
command (in the Project menu) creates a new target for the iPad and modifies a copy of your project’s
nib files to support the larger screen size. For more information on how to use this command, see iPad
Programming Guide.
■ Xcode simplifies the validation and submission process of your applications by allowing you to debug
signed applications.
■ You can now easily transfer your iPhone developer identity information to a new computer. The Organizer
window includes an option to export your profile and certificate information. To begin developing on
a new computer, all you have to do is import the resulting data file into Xcode on that computer.
■ Interface Builder supports the new view controllers and window sizes available for iPad.

API Changes

The following frameworks and technologies include additional incremental changes.

UIKit Framework Changes


The UIKit framework includes the following additions:

■ The UIBezierPath class is a new class that supports the creation of vector-based shapes. This class
provides an object-oriented wrapper around Core Graphics paths.
■ The UIScrollViewDelegate protocol includes additional methods for processing zoom-related events
in a scroll view.
■ Modal view controllers can now be presented in a style other than full screen. The UIViewController
class includes a modalPresentationStyle property that allows you to present modal view controllers
using one of several predefined styles.
■ The UIMenuController class now allows you to add custom menu items. You can use custom menu
items to augment the Cut, Copy, Paste, and Select behavior provided by the system.
■ The UITextChecker class supports spell-checking of strings and aids in word completion.
■ Support for popovers, described in “Popovers” (page 19).
■ The UISplitViewController class, described in “Split Views” (page 19).
■ Support for gesture recognizers, described in “Gesture Recognizers” (page 20).
■ Support for implementing custom input and accessory views, described in “Custom Input Views” (page
20).
■ Support for getting information about externally connected displays, described in “External Display
Support” (page 20).
■ Support for creating PDF files, described in “PDF Generation” (page 23).
■ Support for previewing and opening documents, described in “Document Support” (page 23).

For more information about the classes of the UIKit framework, see UIKit Framework Reference.

24 API Changes
2010-04-30 | © 2010 Apple Inc. All Rights Reserved.
iPhone OS 3.2

Media Player Framework Changes


The video classes in the Media Player framework (MediaPlayer.framework) have been redesigned to give
you more control over the presentation of video content. Instead of simply playing a video full screen, the
MPMoviePlayerController class now vends a view that you can incorporate into your interface however
you want. This class also includes more sophisticated support for managing and controlling the playback of
movies.

For situations where you want a simpler alternative to movie presentation, you can now use the
MPMoviePlayerViewController class. This new class provides a view controller-based wrapper for a movie
interface and is for applications that want the same basic behavior offered by the older movie player controller
design.

For information about the new classes available in this framework, see Media Player Framework Reference.

Core Animation Changes


The Core Animation technology (defined in QuartzCore.framework) includes the following additional
features:

■ The CATextLayer class is now available for incorporating text-based content into your layer hierarchies.
■ You can now apply shadow effects to a layer and customize the appearance of the shadow using the
shadowOpacity, shadowRadius, shadowOffset, shadowColor, and shadowPath properties.

■ You can configure the rasterization behavior of the layer using the shouldRasterize and
rasterizationScale properties.

For more information about Core Animation classes, see Core Animation Reference Collection.

MapKit Framework Changes


The MKReverseGeocoder class now includes a placemark property for accessing the placemark that was
computed by the reverse geocoding service. You can use this property to retrieve placemark information
after the results are reported to the associated delegate object.

For more information about the classes of the MapKit framework, see Map Kit Framework Reference.

Foundation Framework Changes


The NSString class now includes the ability to search the text of a string using regular expressions. The
NSStringCompareOptions type includes a new flag called NSRegularExpressionSearch, which you
can use in conjunction with the following methods:

■ rangeOfString:options:

■ rangeOfString:options:range:

■ rangeOfString:options:range:locale:

API Changes 25
2010-04-30 | © 2010 Apple Inc. All Rights Reserved.
iPhone OS 3.2

When you pass the NSRegularExpressionSearch as an option, the search string is interpreted as a regular
expression instead of a string literal. The regular expression syntax conforms to the syntax used by the
International Components for Unicode (ICU) library. When performing regular expression searches, the only
other options you can include in the mask parameter are the NSCaseInsensitiveSearch and the
NSAnchoredSearch flags.

Because some regular expressions can trigger a match but still return a zero-length range, you should check
both the location and range length of the result. If a match was unsuccessful, the search methods always
return a range whose location is set to NSNotFound and whose length is 0.

For more information about the NSString class and its methods, see NSString Class Reference. For more
information about regular expressions in the ICU library, go to http://site.icu-project.org/.

26 API Changes
2010-04-30 | © 2010 Apple Inc. All Rights Reserved.
iPhone OS 3.1

This article summarizes the features that are available beginning with iPhone OS 3.1. For the latest updates
and information, you should also see iPhone SDK Release Notes for iPhone OS 3.1.

Video Editing Support

The UIKit framework now includes the UIVideoEditorController class, which provides a standard user
interface for editing video clips on supported devices.

Core Animation Enhancements

Introduced in iPhone OS 3.1, the CADisplayLink class is essentially a timer whose notifications are
synchronized with the screen refresh rate (or some partial interval thereof ). Graphics-intensive applications
can use these notifications as a signal to begin preparing the next frame of content.

For more information about how to use this class, see CADisplayLink Class Reference.

Instruments

In iPhone OS 3.1 and later, the Instruments application includes support for gathering performance data
wirelessly over Wi-Fi. This support allows you to gather performance metrics for applications that might need
to use the 30-pin dock connector for other purposes. For example, you could use it to gather performance
data for an application that is communicating with an external accessory.

For more information about how to use this feature, see Instruments User Guide.

Video Editing Support 27


2010-04-30 | © 2010 Apple Inc. All Rights Reserved.
iPhone OS 3.1

28 Instruments
2010-04-30 | © 2010 Apple Inc. All Rights Reserved.
iPhone OS 3.0

This article summarizes the key features that are available beginning with iPhone OS 3.0. It also lists many
of the documents that were created or updated for the release.

Apple Push Notification Service

The Apple Push Notification Service provides a way to alert your users of new information, even when your
application is not actively running. Using this service, you can push text notifications, trigger audible alerts,
or add a numbered badge to your application icon. These messages let users know that they should open
your application to receive the related information.

From a design standpoint, there are two parts to making push notifications work for your iPhone applications.
First, you need to request the delivery of notifications to your iPhone application and then you need to
configure your application delegate to process them. The delegate works together with the shared
UIApplication object to perform both of these tasks. Second, you need to provide a server-side process
to generate the notifications in the first place. This process lives on your own local server and works with
Apple Push Notification Service to trigger the notifications.

For more information about how to configure your application to use remote notifications, see Local and
Push Notification Programming Guide.

Cut, Copy, and Paste

The UIKit framework provides new classes to support pasteboard operations and also incorporates selection
and pasteboard behaviors into some existing UIKit views. You can use the new classes to incorporate support
cut, copy, and paste behaviors into your application. One of the key new classes is the UIPasteboard class,
which manages the content on the systemwide pasteboards. It is through this class that you can now store
selected content and transfer it within your application or to other applications.

The UIPasteboard object provides built-in support for storing standard data types such as strings, images,
colors, and URLs. These types represent some of the most common data types and make it easier to exchange
content between applications. However, you can also exchange content in custom data formats supported
only by your application or in more standardized interchange formats.

Several existing UIKit views now provide automatic support for text selection and pasteboard operations. In
particular, the UITextField, UITextView, and UIWebView classes automatically handle text selections and
the display of an editing menu with the appropriate Cut, Copy, Paste, Select, and Select all commands.

For custom views, the UIKit framework also includes the UIMenuController class for managing the editing
menu. You use this class, together with your application’s own custom selection behavior, to allow the user
to cut, copy, paste, and select custom content. The menu displays standard commands to cut or copy the
selected content or to paste new content based on the operations currently supported by your view.

Apple Push Notification Service 29


2010-04-30 | © 2010 Apple Inc. All Rights Reserved.
iPhone OS 3.0

For information about how to incorporate pasteboard support into your application, see “Document Revision
History” in iPhone Application Programming Guide. You should also consult “Handling Common Tasks” in
iPhone Human Interface Guidelines for information about the interface guidelines associated with supporting
cut, copy, and paste operations.

Accessory Support

The External Accessory framework (ExternalAccessory.framework) provides support for communicating


with hardware accessories attached to an iPhone or iPod touch device. Accessories can be connected through
the 30-pin dock connector of a device or wirelessly using Bluetooth. The External Accessory framework
provides a way for you to get information about each available accessory and to initiate communications
sessions. After that, you are free to manipulate the accessory directly using any commands it supports.

For more information about how to use this framework, see “Device Support” in iPhone Application
Programming Guide. For information about the classes of the External Accessory framework, see External
Accessory Framework Reference. For information about developing accessories for iPhone and iPod touch
devices, go to http://developer.apple.com.

In App Purchase Support

The Store Kit framework (StoreKit.framework) provides a means for you to make additional content and
services available from within your iPhone applications. For example, you could use this feature to allow the
user to unlock additional application features. Or if you are a game developer, you could use it to offer
additional game levels. In both cases, the Store Kit framework handles the financial aspects of the transaction,
processing payment requests through the user’s iTunes Store account and providing your application with
information about the purchase.

The Store Kit focuses on the financial aspects of a transaction, ensuring that transactions occur securely and
correctly. Your application handles the other aspects of the transaction, including the presentation of a
purchasing interface and the downloading (or unlocking) of the appropriate content. This division of labor
gives you control over the user experience for purchasing content. You decide what kind of purchasing
interface you want to present to the user and when to do so. You also decide on the delivery mechanism
that works best for your application.

For information about how to use the Store Kit framework, see In App Purchase Programming Guide and Store
Kit Framework Reference.

Peer to Peer Support

The Game Kit framework (GameKit.framework) lets you add peer-to-peer network capabilities to your
applications. Specifically, this framework provides support for peer-to-peer connectivity and in-game voice
features. Although these features are most commonly found in multiplayer network games, you can incorporate
them into non-game applications as well. The framework provides you with networking features through a
simple (yet powerful) set of classes built on top of Bonjour. These classes abstract out many of the network
details, making it easy for developers who might be inexperienced with networking programming to
incorporate networking features into their applications.

30 Accessory Support
2010-04-30 | © 2010 Apple Inc. All Rights Reserved.
iPhone OS 3.0

For more information about how to use the Game Kit framework, see Game Kit Programming Guide and Game
Kit Framework Reference.

Maps API

The Map Kit framework (MapKit.framework) provides a map interface that you can embed into your own
application. Based on the behavior of this interface within the Maps application, this interface provides a
scrollable map view that can be annotated with custom information. You can embed this view inside of your
own application views and programmatically set various attributes of the map, including the currently
displayed map region and the user’s location. You can also define custom annotations or use standard
annotations (such as a pin marker) to highlight regions of the map and display additional information.

For more information about the classes of the Map Kit framework, see Map Kit Framework Reference.

iPod Library Access

Several new classes and protocols have been added to the Media Player framework
(MediaPlayer.framework) to allow access to the user’s audio library. You can use these classes to perform
the following tasks:

■ Play audio items from the user’s library. This support lets you play all audio types supported by the iPod
application.
■ Construct queues of audio items to play back.
■ Perform searches of the user’s audio library.
■ Access the user’s playlists (including smart, on-the-go, and genius playlists).

For more information about the classes of the Media Player framework, see Media Player Framework Reference.

Audio Recording and Management

The AV Foundation framework (AVFoundation.framework) includes the following new classes and protocols
for recording audio and managing audio sessions:

■ The AVAudioRecorder class provides audio recording capabilities. This class works together with an
audio delegate (conforming to the AVAudioRecorderDelegate protocol) to manage state changes
during recording.
■ The AVAudioSession class provides control over audio context including audio session category, sample
rate, and I/O buffer duration. This class works with an audio session delegate (conforming to the
AVAudioSessionDelegate protocol) to respond to audio hardware route changes and audio
interruptions.
■ New constants for configuring audio formats, audio encoding, and sample rate conversion for recording.

Maps API 31
2010-04-30 | © 2010 Apple Inc. All Rights Reserved.
iPhone OS 3.0

For more information about the classes of the AV Foundation framework, see AV Foundation Framework
Reference.

Core Data

The Core Data framework (CoreData.framework) is a technology for managing the data model of a
Model-View-Controller application. Core Data is intended for use in applications where the data model is
already highly structured. Instead of defining data structures programmatically, you use the graphical tools
in Xcode to build a schema representing your data model. At runtime, instances of your data-model entities
are created, managed, and made available through the Core Data framework.

By managing your application’s data model for you, Core Data significantly reduces the amount of code you
have to write for your application. Core Data also provides the following features:

■ Storage of object data in a SQLite database for optimal performance


■ A new NSFetchedResultsController class to manage results for table views
■ Management of undo/redo beyond basic text editing
■ Support for the validation of property values
■ Support for propagating changes and ensuring that the relationships between objects remain consistent
■ Support for grouping, filtering, and organizing data in memory

If you are starting to develop a new application or are planning a significant update to an existing application,
you should consider using Core Data. For an example of how to use Core Data in an iPhone application, see
Core Data Tutorial for iPhone OS. For more information about the classes of the Core Data framework, see
Core Data Framework Reference.

In App Email

The Message UI framework (MessageUI.framework) is a new framework that provides support for composing
and queuing email messages in the user’s outbox. The composition support consists of a view controller
interface that you can present in your application. You can populate the fields of this interface with the
contents of the message you want to send. You can set the recipients, subject, body content, and any
attachments you want to include with the message. The user then has the option of editing the message
prior to accepting it. Once accepted, the message is queued in the user’s outbox for delivery.

For more information about the classes of the Message UI framework, see Message UI Framework Reference.

Streaming Video

There is now support for the playback of live video streamed over http. Streamed content can be played
back on an iPhone OS–based device using the MPMoviePlayerController class. The semantics of using
this class have not changed. The main differences are in the preparation of the streamed content and how
it is published on a web server.

32 Core Data
2010-04-30 | © 2010 Apple Inc. All Rights Reserved.
iPhone OS 3.0

For more information about how to prepare content for video streaming, see HTTP Live Streaming Overview.

Safari Features

Safari supports the audio and video HTML elements, which allow you to embed audio and video content
into your web applications. Safari also supports the Geolocation JavaScript classes, which work with the
onboard location services to retrieve the current location of the device.

For more information about how to use these features in your web applications, see Safari Web Content Guide.

Shared Keychain Items

It is now possible for you to share Keychain items among multiple applications you create. Sharing items
makes it easier for applications in the same suite to interoperate more smoothly. For example, you could use
this feature to share user passwords or other elements that might otherwise require you to prompt the user
from each application separately.

Sharing Keychain items involves setting up the proper entitlements in your application binaries. Using Xcode,
you must create an Entitlements property list file that includes the supported entitlements for your application.
The process for creating this file is described in iPhone Development Guide. For information about the
entitlements you can configure, see the description for the SecItemAdd function in Keychain Services Reference.

Accessing shared items at runtime involves using the Keychain Services programming interface with the
access groups you set up during development. For information about how to access the Keychain, see
Keychain Services Programming Guide.

Accessibility Support

Accessibility support makes it easier for people with visual, auditory, and physical disabilities to use iPhone
OS–based devices. In addition, users with the appropriate hardware can take advantage of the following
features:

■ Zoom - magnifies the entire screen of the device.


■ White on Black - inverts the colors on the display.
■ Mono Audio - combines the left and right channels into a mono signal that is played in both audio
channels.
■ Speak auto-text - speaks the text that users type, along with any corrections or suggestions made by
the system.
■ Voice Control - allows users to make phone calls and control iPod playback using voice commands.
■ VoiceOver - provides an audible description of the elements touched and the actions taken by the user.

Safari Features 33
2010-04-30 | © 2010 Apple Inc. All Rights Reserved.
iPhone OS 3.0

Developers can make their own applications accessible to VoiceOver users by taking advantage of the support
built-in to the UIKit framework. All standard system views and controls now provide default descriptions for
use by VoiceOver. However, you can use the new accessibility interfaces in UIKit to improve on the default
support and provide more accurate descriptions of your application’s views and controls. Providing more
context-aware descriptions gives disabled users better access to your application’s content.

For information about how to make your own applications accessible, see Accessibility Programming Guide
for iPhone OS.

Compass Support

The Core Location framework now includes support for obtaining heading information from iPhone OS–based
devices with a built-in magnetometer. Heading information obtained from such devices can be used to
implement a real-time compass or other navigation-related programs.

For more information about accessing compass information, see Core Location Framework Reference.

OpenGL ES 2.0

Applications can now take advantage of the OpenGL ES 2.0 specification on iPhone OS–based devices with
appropriate graphics hardware. OpenGL ES 2.0 is a new version of the OpenGL ES specification that offers
features not available in OpenGL ES 1.1. Specifically, the new version provides support for shaders, including
fragment and vertex shaders. The use of shaders now eliminates the need for many of the fixed function
interfaces that were part of the OpenGL ES 1.1 specification.

Note: OpenGL ES 1.1 is supported on all iPhone OS–based devices, whereas OpenGL ES 2.0 is supported
only on newer hardware.

For more information about OpenGL ES 2.0 in particular, and about OpenGL ES support in general, see OpenGL
ES Programming Guide for iPhone OS.

Additional Enhancements

In addition to the major new features in iPhone OS, several frameworks and technologies have received
incremental updates to improve the development experience.

UIKit Framework Enhancements


The UIKit framework (UIKit.framework) has been enhanced to support major new features in iPhone OS
3.0, such as cut, copy, and paste operations. In addition, this framework has some new classes and has minor
improvements to existing classes, including the following:

34 Compass Support
2010-04-30 | © 2010 Apple Inc. All Rights Reserved.
iPhone OS 3.0

■ New classes (UIPasteboard and UIMenuController) and general improvements to the UITextField,
UITextView, and UIWebView classes to support the selection of text and to support cut, copy, and
paste operations
■ Support for handling “motion” events, which currently consist of shake events. Typically, you use shake
events to initiate undo operations but you may use them for other purposes as well; see “Document
Revision History” in iPhone Application Programming Guide for more information.
■ Support in the UIDevice class for accessing the battery state and proximity sensor
■ Support for capturing video (on hardware that supports it) using the UIImagePickerController class
■ Enhancements to search bar controls, including the new UISearchDisplayController class to manage
search results
■ New support for one-step view rotations from a view controller; see UIViewController Class Reference
■ New modal transition styles, including support for flip and cross-fade transitions; see UIViewController
Class Reference
■ Navigation controller support for a standard built-in toolbar whose contents can change to reflect the
currently active view controller; see UINavigationController Class Reference
■ Improvements to table views, including support for new cell styles, more table reloading options, and
support for customizing the title of delete confirmation buttons. There is also a new class
(UILocalizedIndexedCollation) to help with data sorting and organization for table view sections.
■ Support for content stretching in the UIView class, which allows the creation of 3- or 9-part stretched
images without using a stretchable UIImage or multiple image views
■ Enhanced support for data detection in the UITextView and UIWebView classes. This support lets you
configure what types of data (phone numbers, URLS, and addresses) should be automatically detected
in text and converted to clickable links.
■ Enhanced support in UIWebView for displaying previews of RTF, RTFD, PDF, iWork, and Office documents

For more information about the classes of the UIKit framework, see UIKit Framework Reference. For guidance
on when to use the new features in your applications, see iPhone Human Interface Guidelines.

Foundation Framework Enhancements


The Foundation framework (Foundation.framework) has been updated to support the following features
related to undo management and Core Data:

■ Inclusion of the NSUndoManager class to support Core Data and general undo operations
■ Inclusion of the NSExpression, NSPredicate, NSComparisonPredicate, NSCompoundPredicate,
and NSValueTransformer classes to support Core Data

For more information about the classes of the Foundation framework, see Foundation Framework Reference.

Core Audio Enhancements


Enhancements have been made to the Audio Toolbox, Audio Unit, and Core Audio frameworks, including
the following additions:

Additional Enhancements 35
2010-04-30 | © 2010 Apple Inc. All Rights Reserved.
iPhone OS 3.0

■ New support for decoding MP3 and AAC audio content in software. This support effectively allows you
to play multiple compressed files simultaneously (one using the hardware decoder and one or more
using the software decoder).
■ Enhanced support in the Audio Toolbox framework for determining if audio codecs are available in
software, hardware, or both
■ Enhanced support in the Audio Unit framework for registering your audio units and connecting audio
unit processing graphs in your iPhone application
■ Support for three new audio formats:
❏ DVI/Intel IMA ADPCM
❏ Microsoft GSM 6.10
❏ AES3-2003

For more information about the Core Audio interfaces, see Audio Toolbox Framework Reference, Audio Unit
Framework Reference, and Core Audio Framework Reference.

API Changes

For information about the changes that occurred between iPhone OS 2.0 and iPhone OS 2.2, see iPhone 2.1
API Diffs and iPhone 2.2 API Diffs. For information about the changes that occurred between iPhone OS 2.2
and iPhone OS 3.0, see iPhone OS 3.0 API Diffs.

36 API Changes
2010-04-30 | © 2010 Apple Inc. All Rights Reserved.
Document Revision History

This table describes the changes to What's New in iPhone OS.

Date Notes

2010-04-30 Added information about new features in iPhone OS 4.0.

2010-03-24 Moved the iPhone OS 3.1 information to its own article and added a new article
covering features in iPhone OS 3.2.

2009-08-27 Updated the iPhone OS 3.0 article to reflect features introduced in all 3.x versions
of iPhone OS.

2009-06-16 Added new features related to the introduction of new iPhone hardware.

37
2010-04-30 | © 2010 Apple Inc. All Rights Reserved.
Document Revision History

38
2010-04-30 | © 2010 Apple Inc. All Rights Reserved.

Vous aimerez peut-être aussi