Whats New Ini Phone Os

16

Click here to load reader

Transcript of Whats New Ini Phone Os

Page 1: Whats New Ini Phone Os

What's New in iPhone OSGeneral

2009-04-07

Page 2: Whats New Ini Phone Os

Apple Inc.© 2009 Apple Inc.All rights reserved.

No part of this publication may be reproduced,stored in a retrieval system, or transmitted, inany form or by any means, mechanical,electronic, photocopying, recording, orotherwise, without prior written permission ofApple Inc., with the following exceptions: Anyperson is hereby authorized to storedocumentation on a single computer forpersonal use only and to print copies ofdocumentation for personal use provided thatthe documentation contains Apple’s copyrightnotice.

The Apple logo is a trademark of Apple Inc.

Use of the “keyboard” Apple logo(Option-Shift-K) for commercial purposeswithout the prior written consent of Apple mayconstitute trademark infringement and unfaircompetition in violation of federal and statelaws.

No licenses, express or implied, are grantedwith respect to any of the technology describedin this document. Apple retains all intellectualproperty rights associated with the technologydescribed in this document. This document isintended to assist application developers todevelop applications only for Apple-labeledcomputers.

Every effort has been made to ensure that theinformation in this document is accurate. Appleis not responsible for typographical errors.

Apple Inc.1 Infinite LoopCupertino, CA 95014408-996-1010

iTunes Store is a registered service mark ofApple Inc.

Apple, the Apple logo, Bonjour, iPod, iTunes,iWork, Keychain, Safari, and Xcode aretrademarks of Apple Inc., registered in theUnited States and other countries.

iPhone is a trademark of Apple Inc.

Intel and Intel Core are registered trademarksof Intel Corportation or its subsidiaries in theUnited States and other countries.

Java and all Java-based trademarks aretrademarks or registered trademarks of SunMicrosystems, Inc. in the U.S. and othercountries.

Simultaneously published in the United Statesand Canada.

Even though Apple has reviewed this document,APPLE MAKES NO WARRANTY OR REPRESENTATION,EITHER EXPRESS OR IMPLIED, WITH RESPECT TOTHIS DOCUMENT, ITS QUALITY, ACCURACY,MERCHANTABILITY, OR FITNESS FOR A PARTICULARPURPOSE. AS A RESULT, THIS DOCUMENT ISPROVIDED “AS IS,” AND YOU, THE READER, AREASSUMING THE ENTIRE RISK AS TO ITS QUALITYAND ACCURACY.

IN NO EVENT WILL APPLE BE LIABLE FOR DIRECT,INDIRECT, SPECIAL, INCIDENTAL, ORCONSEQUENTIAL DAMAGES RESULTING FROM ANYDEFECT OR INACCURACY IN THIS DOCUMENT, evenif advised of the possibility of such damages.

THE WARRANTY AND REMEDIES SET FORTH ABOVEARE EXCLUSIVE AND IN LIEU OF ALL OTHERS, ORALOR WRITTEN, EXPRESS OR IMPLIED. No Appledealer, agent, or employee is authorized to makeany modification, extension, or addition to thiswarranty.

Some states do not allow the exclusion or limitationof implied warranties or liability for incidental orconsequential damages, so the above limitation orexclusion may not apply to you. This warranty givesyou specific legal rights, and you may also haveother rights which vary from state to state.

Page 3: Whats New Ini Phone Os

Contents

Introduction 5

Organization of This Document 5

iPhone OS 3.0 7

Apple Push Notification Service 7Cut, Copy, and Paste 7Accessory Support 8In App Purchase Support 8Peer to Peer Support 8Maps API 9iPod Library Access 9Audio Recording and Management 9Core Data 10In App Email 10Streaming Video 10Safari Features 11Shared Keychain Items 11Additional Enhancements 11

UIKit Framework Enhancements 11Foundation Framework Enhancements 12Core Audio Enhancements 12

Document Revision History 15

32009-04-07 | © 2009 Apple Inc. All Rights Reserved.

Page 4: Whats New Ini Phone Os

42009-04-07 | © 2009 Apple Inc. All Rights Reserved.

Page 5: Whats New Ini Phone Os

Important: This is a preliminary document for an API or technology in development. Although this documenthas been reviewed for technical accuracy, it is not final. Apple is supplying this information to help you planfor the adoption of the technologies and programming interfaces described herein. This information is subjectto change, and software implemented according to this document should be tested with final operatingsystem software and final documentation. Newer versions of this document may be provided with futureseeds of the API or technology. For information about updates to this and other developer documentation,view the New & Updated sidebars in subsequent documentation seeds.

This document provides developer-level information about features that were introduced in different versionsof iPhone OS.

This document is not intended as a complete list of features for each new version of iPhone OS. Instead, itfocuses on those features that affect the development of third-party software, providing overviews of eachfeature along with insight as to how and when you might use them to create your own software. Whereverpossible, this document also provides links to other Apple conceptual and reference documentation for thatfeature.

Organization of This Document

This document includes the following article:

■ “iPhone OS 3.0” (page 7) describes the new and updated features in iPhone OS 3.0.

Organization of This Document 52009-04-07 | © 2009 Apple Inc. All Rights Reserved.

Introduction

Page 6: Whats New Ini Phone Os

6 Organization of This Document2009-04-07 | © 2009 Apple Inc. All Rights Reserved.

Introduction

Page 7: Whats New Ini Phone Os

This article summarizes the key features that are available beginning with iPhone OS 3.0. It also lists manyof 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 yourapplication 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 openyour 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 toconfigure your application delegate to process them. The delegate works together with the sharedUIApplication object to perform both of these tasks. Second, you need to provide a server-side processto generate the notifications in the first place. This process lives on your own local server and works withApple Push Notification Service to trigger the notifications.

For more information about how to configure your application to use remote notifications, see Apple PushNotification Service Programming Guide.

Cut, Copy, and Paste

In iPhone OS 3.0, the UIKit framework provides new classes to support pasteboard operations and alsoincorporates selection and pasteboard behaviors into some existing UIKit views. You can use the new classesto incorporate support cut, copy, and paste behaviors into your application. One of the key new classes isthe UIPasteboard class, which manages the content on the systemwide pasteboards. It is through this classthat 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 exchangecontent between applications. However, you can also exchange content in custom data formats supportedonly by your application or in more standardized interchange formats.

Several existing UIKit views now provide automatic support for text selection and pasteboard operations. Inparticular, the UITextField, UITextView, and UIWebView classes automatically handle text selections andthe 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 editingmenu. You use this class, together with your application’s own custom selection behavior, to allow the userto cut, copy, paste, and select custom content. The menu displays standard commands to cut or copy theselected content or to paste new content based on the operations currently supported by your view.

Apple Push Notification Service 72009-04-07 | © 2009 Apple Inc. All Rights Reserved.

iPhone OS 3.0

Page 8: Whats New Ini Phone Os

For information about how to incorporate pasteboard support into your application, see Event Handling iniPhone Application Programming Guide. You should also consult Handling Common Tasks in iPhone HumanInterface Guidelines for information about the interface guidelines associated with supporting cut, copy, andpaste operations.

Accessory Support

The External Accessory framework (ExternalAccessory.framework) provides support for communicatingwith hardware accessories attached to an iPhone or iPod touch device. Accessories can be connected throughthe 30-pin dock connector of a device or wirelessly using Bluetooth. The External Accessory frameworkprovides a way for you to get information about each available accessory and to initiate communicationssessions. 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 iPhoneApplicationProgrammingGuide. For information about the classes of the External Accessory framework, see External Accessory FrameworkReference. For information about developing accessories for iPhone and iPod touch devices, go to http://de-veloper.apple.com.

In App Purchase Support

The Store Kit framework (StoreKit.framework) provides a means for you to make additional content andservices available from within your iPhone applications. For example, you could use this feature to allow theuser to unlock additional application features. Or if you are a game developer, you could use it to offeradditional 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 withinformation about the purchase.

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

For information about how to use the Store Kit framework, see Store Kit Programming Guide and Store KitFramework Reference.

Peer to Peer Support

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

8 Accessory Support2009-04-07 | © 2009 Apple Inc. All Rights Reserved.

iPhone OS 3.0

Page 9: Whats New Ini Phone Os

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

Maps API

The Map Kit framework (MapKit.framework) provides a map interface that you can embed into your ownapplication. Based on the behavior of this interface within the Maps application, this interface provides ascrollable map view that can be annotated with custom information. You can embed this view inside of yourown application views and programmatically set various attributes of the map, including the currentlydisplayed map region and the user’s location. You can also define custom annotations or use standardannotations (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 MapKit 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 performthe following tasks:

■ Play audio items from the user’s library. This support lets you play all audio types supported by the iPodapplication.

■ 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, seeMediaPlayer FrameworkReference.

Audio Recording and Management

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

■ The AVAudioRecorder class provides audio recording capabilities. This class works together with anaudio delegate (conforming to the AVAudioRecorderDelegate protocol) to manage state changesduring recording.

■ The AVAudioSession class provides control over audio context including audio session category, samplerate, and I/O buffer duration. This class works with an audio session delegate (conforming to theAVAudioSessionDelegate protocol) to respond to audio hardware route changes and audiointerruptions.

■ New constants for configuring audio formats, audio encoding, and sample rate conversion for recording.

Maps API 92009-04-07 | © 2009 Apple Inc. All Rights Reserved.

iPhone OS 3.0

Page 10: Whats New Ini Phone Os

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

Core Data

The Core Data framework (CoreData.framework) is a technology for managing the data model of aModel-View-Controller application. Core Data is intended for use in applications where the data model isalready highly structured. Instead of defining data structures programmatically, you use the graphical toolsin Xcode to build a schema representing your data model. At runtime, instances of your data-model entitiesare 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 youhave 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, seeCore Data Tutorial for iPhone OS. For more information about the classes of the Core Data framework, seeCore Data Framework Reference.

In App Email

The Message UI framework (MessageUI.framework) is a new framework that provides support for composingand queuing email messages in the user’s outbox. The composition support consists of a view controllerinterface that you can present in your application. You can populate the fields of this interface with thecontents of the message you want to send. You can set the recipients, subject, body content, and anyattachments you want to include with the message. The user then has the option of editing the messageprior 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

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

10 Core Data2009-04-07 | © 2009 Apple Inc. All Rights Reserved.

iPhone OS 3.0

Page 11: Whats New Ini Phone Os

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

Safari Features

In iPhone OS 3.0 and later, Safari supports the audio and video HTML elements, which allow you to embedaudio 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 SafariWeb Content Guidefor iPhone OS.

Shared Keychain Items

In iPhone OS 3.0 and later, it is now possible for you to share Keychain items among multiple applicationsyou 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 otherwiserequire 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 theentitlements 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 theaccess groups you set up during development. For information about how to access the Keychain, seeKeychain Services Programming Guide.

Additional Enhancements

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

UIKit Framework Enhancements

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

■ 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, andpaste operations

■ Support for handling “motion” events, which currently consist of shake events. Typically, you use shakeevents to initiate undo operations but you may use them for other purposes as well; see Event Handlingin iPhone Application Programming Guide for more information.

Safari Features 112009-04-07 | © 2009 Apple Inc. All Rights Reserved.

iPhone OS 3.0

Page 12: Whats New Ini Phone Os

■ Support in the UIDevice class for accessing the battery state and proximity sensor

■ Enhancements to search bar controls, including the new UISearchDisplayController class to managesearch 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 UIViewControllerClass Reference

■ Navigation controller support for a standard built-in toolbar whose contents can change to reflect thecurrently active view controller; see UINavigationController Class Reference

■ Improvements to table views, including support for new cell styles, more table reloading options, andsupport 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 stretchedimages without using a stretchable UIImage or multiple image views

■ Enhanced support for data detection in the UITextView and UIWebView classes. This support lets youconfigure what types of data (phone numbers, URLS, and addresses) should be automatically detectedin 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 guidanceon 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 featuresrelated 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, includingthe following additions:

■ New support for decoding MP3 and AAC audio content in software. This support effectively allows youto play multiple compressed files simultaneously (one using the hardware decoder and one or moreusing the software decoder).

■ Enhanced support in the Audio Toolbox framework for determining if audio codecs are available insoftware, hardware, or both

■ Enhanced support in the Audio Unit framework for registering your audio units and connecting audiounit processing graphs in your iPhone application

12 Additional Enhancements2009-04-07 | © 2009 Apple Inc. All Rights Reserved.

iPhone OS 3.0

Page 13: Whats New Ini Phone Os

■ 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 UnitFramework Reference, and Core Audio Framework Reference.

Additional Enhancements 132009-04-07 | © 2009 Apple Inc. All Rights Reserved.

iPhone OS 3.0

Page 14: Whats New Ini Phone Os

14 Additional Enhancements2009-04-07 | © 2009 Apple Inc. All Rights Reserved.

iPhone OS 3.0

Page 15: Whats New Ini Phone Os

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

NotesDate

New document describing the features introduced in each version of iPhoneOS.

2009-04-07

152009-04-07 | © 2009 Apple Inc. All Rights Reserved.

Document Revision History

Page 16: Whats New Ini Phone Os

162009-04-07 | © 2009 Apple Inc. All Rights Reserved.

Document Revision History