iOS7 中的新特性
太阳火神的美丽人生 (http://blog.csdn.net/opengl_es)
本文遵循“署名-非商业用途-保持一致”创作公用协议
转载请保留此句:太阳火神的美丽人生 - 本博客专注于 敏捷开发及移动和物联设备研究:iOS、Android、Html5、Arduino、pcDuino,否则,出自本博客的文章拒绝转载或再转载,谢谢合作。
介绍 Introduction
文档组织结构 Organization of This Document
iOS 7.0
用户界面更改 User Interface Changes
UI重新设计 UI Redesign
视图动态行为 Dynamic Behaviors for Views
文本工具箱 Text Kit
64位支持 64-Bit Support
多任务加强 Multitasking Enhancements
游戏 Games
精灵工具箱框架 Sprite Kit Framework
游戏控制器框架 Game Controller Framework
游戏中心改进 Game Center Improvements
地图 Maps
空中投放 AirDrop
应用内音频 Inter-App Audio
点对点联接 Peer-to-Peer Connectivity
新框架 New Frameworks
已有框架的加强 Enhancements to Existing Frameworks
UIKit框架 UIKit Framework
商店工具箱框架 Store Kit Framework
通行证工具箱框架 Pass Kit Framework
开放图形库嵌入式系统版本 OpenGL ES
消息用户界面框架 Message UI Framework
Media Player FrameworkMap Kit Framework
图象读写框架 Image I/O Framework
iAd广告框架 iAd Framework
游戏工具箱框架 Game Kit Framework
基础框架 Foundation Framework
核心电话框架 Core Telephony Framework
核心动作框架 Core Motion Framework
核心位置框架 Core Location Framework
核心基础框架 Core Foundation Framework
核心蓝牙框架 Core Bluetooth Framework
音视频基础框架 AV Foundation Framework
加速框架 Accelerate Framework
Objective-C语言 Objective-C
弃用的API Deprecated APIs
iOS 7.0
iOS 7 是一个主要的更新具有引人注目的特性可以让开发者整合到他们的应用中。用户界面进行了完全重新设计。另外,iOS 7 引入了一个新的动画系统用于创建 2D 和 2.5D 游戏。多媒体加强、点对点联接和许多其它重要特性使 iOS 7 成为自第一版 iPhone SDK 以来最重大的发布版本。
iOS 7 is a major update with compelling features for developers to incorporate into their apps. The user interface has been completely redesigned. In addition, iOS 7 introduces a new animation system for creating 2D and 2.5D games. Multitasking enhancements, peer-to-peer connectivity, and many other important features make iOS 7 the most significant release since the first iPhone SDK.
本文概括了 iOS 7 中引入的关键的开发者相关特性。该版本操作系统仍可运行在当前的 iOS 设备上。除了描述关键的新特性之外,本文还列举了更详尽地描述那些特性的文档。
This article summarizes the key developer-related features introduced in iOS 7. This version of the operating system runs on current iOS devices. In addition to describing the key new features, this article lists the documents that describe those features in more detail.
要获取已知问题的新闻和信息,查看 iOS 7 发布说明。要获取 iOS 7 中新增 API 的完整列表,查看 iOS 7.0 API 差异文档。
For late-breaking news and information about known issues, see iOS 7 Release Notes. For the complete list of new APIs added in iOS 7, see iOS 7.0 API Diffs.
用户界面的更新 User Interface Changes
iOS 7 引入许多新特性想要帮你创建强大的用户界面。
iOS 7 includes many new features intended to help you create great user interfaces.
用户界面重新设计 UI Redesign
iOS 7 用户界面已做了完全重新设计。
The iOS 7 user interface has been completely redesigned. Throughout the system, a sharpened focus on functionality and on the user’s content informs every aspect of design. Translucency, refined visual touches,and fluid, realistic motion impart clarity, depth, and vitality to the user experience. Whether you are creatinga new app or updating an existing one, keep these qualities in mind as you work on the design.
Apps compiled against the iOS 7 SDK automatically receive the new appearance for any standard system viewswhen the app is run on iOS 7. If you use Auto Layout to set the size and position of your views, those viewsare repositioned as needed. But there may still be additional work to do to make sure your interface has theappearance you want. Similarly, if you customize your app’s views, you may need to make changes to supportthe new appearance fully.
For guidance on how to design apps that take full advantage of the new look in iOS 7, seeiOS 7 Design Re-sources.
Dynamic Behaviors for Views
Apps can now specify dynamic behaviors forUIViewobjects and for other objects that conform to theUIDynamicItemprotocol. (Objects that conform to this protocol are calleddynamic items.) Dynamic behaviorsoffer a way to improve the user experience of your app by incorporating real-world behavior and characteristics,such as gravity, into your app’s animations. UIKit supports the following types of dynamic behaviors:
A UIAttachmentBehaviorobject specifies a connection between two dynamic items or between anitem and a point. When one item (or point) moves, the attached item also moves. The connection is notcompletely static, though. An attachment behavior has damping and oscillation properties that determinehow the behavior changes over time.
A UICollisionBehaviorobject lets dynamic items participate in collisions with each other and withthe behavior’s specified boundaries. The behavior also lets those items respond appropriately to collisions.
A UIGravityBehaviorobject specifies a gravity vector for its dynamic items. Dynamic items acceleratein the vector’s direction until they collide with other appropriately configured items or with a boundary.
A UIPushBehaviorobject specifies a continuous or instantaneous force vector for its dynamic items.
A UISnapBehaviorobject specifies a snap point for a dynamic item. The item snaps to the point with a
configured effect. For example, it can snap to the point as if it were attached to a spring.
Dynamic behaviors become active when you add them to an animator object, which is an instance of theUIDynamicAnimatorclass. The animator provides the context in which dynamic behaviors execute. A givendynamic item can have multiple behaviors, but all of those behaviors must be animated by the same animatorobject.
For information about the behaviors you can apply, seeUIKit Framework Reference.
Text Kit
Text Kit is a full-featured set of UIKit classes for managing text and fine typography. Text Kit can lay out styledtext into paragraphs, columns, and pages; it easily flows text around arbitrary regions such as graphics; and itmanages multiple fonts. Text Kit is integrated with all UIKit text-based controls to enable apps to create, edit,display, and store text more easily—and with less code than was previously possible in iOS.
Text Kit comprises new classes and extensions to existing classes, including the following:
The NSAttributedStringclass has been extended to support new attributes.
The NSLayoutManagerclass generates glyphs and lays out text.
The NSTextContainerclass defines a region where text is laid out.
The NSTextStorageclass defines the fundamental interface for managing text-based content.
For more information about Text Kit, seeText Programming Guide for iOS.
64-Bit Support
Apps can now be compiled for the 64-bit runtime. All system libraries and frameworks are 64-bit ready, meaningthat they can be used in both 32-bit and 64-bit apps. When compiled for the 64-bit runtime, apps may runfaster because of the availability of extra processor resources in 64-bit mode.
iOS uses the same LP64 model that is used by OS X and other 64-bit UNIX systems, which means fewer problemswhen porting code. For information about the iOS 64-bit runtime and how to write 64-bit apps, see64-BitTransition Guide for Cocoa Touch.
Multitasking Enhancements
iOS 7 supports two new background execution modes for apps:
Apps that regularly update their content by contacting a server can register with the system and belaunched periodically to retrieve that content in the background. To register, include theUIBackgroundModeskey with thefetchvalue in your app’sInfo.plistfile. Then, when your app islaunched, call thesetMinimumBackgroundFetchInterval:method to determine how often it receivesupdate messages. Finally, you must also implement theapplication:performFetchWithCompletionHandler:method in your app delegate.
Apps that use push notifications to notify the user that new content is available can fetch the content inthe background. To support this mode, include theUIBackgroundModeskey with theremote-notificationvalue in your app’sInfo.plistfile. You must also implement theapplication:didReceiveRemoteNotification:fetchCompletionHandler:method in your appdelegate.
Apps supporting either thefetchorremote-notificationbackground modes may be launched or movedfrom the suspended to background state at appropriate times. In the case of thefetchbackground mode,the system uses available information to determine the best time to launch or wake apps. For example, it doesso when networking conditions are good or when the device is already awake. You can also send silent pushnotifications—that is, notifications that do not display alerts or otherwise disturb the user.
For small content updates, use theNSURLRequestclass. To upload or download larger pieces of content inthe background, use the newNSURLSessionclass. This class improves on the existingNSURLConnectionclass by providing a simple, task-based interface for initiating and processingNSURLRequestobjects. A singleNSURLSessionobject can initiate multiple download and upload tasks, and use its delegate to handle anyauthentication requests coming from the server.
For more information about the new background modes, see “App States and Multitasking” iniOS AppProgramming Guide.
Games
iOS 7 includes enhanced support for games.
Sprite Kit Framework
The Sprite Kit framework (SpriteKit.framework) provides a hardware-accelerated animation systemoptimized for creating 2D and 2.5D games. Sprite Kit provides the infrastructure that most games need, includinga graphics rendering and animation system, sound playback support, and a physics simulation engine. UsingSprite Kit frees you from creating these things yourself, and it lets you focus on the design of your content andthe high-level interactions for that content.
Content in a Sprite Kit app is organized into scenes. A scene can include textured objects, video, path-basedshapes, Core Image filters, and other special effects. Sprite Kit takes those objects and determines the mostefficient way to render them onscreen. When it is time to animate the content in your scenes, you can useSprite Kit to specify explicit actions you want performed, or you can use the physics simulation engine to definephysical behaviors (such as gravity, attraction, or repulsion) for your objects.
In addition to the Sprite Kit framework, there are Xcode tools for creating particle emitter effects and textureatlases. You can use the Xcode tools to manage app assets and update Sprite Kit scenes quickly.
For more information about how to use Sprite Kit, seeSprite Kit Programming Guide. To see an example ofhow to use Sprite Kit to build a working app, seecode:Explained Adventure.
Game Controller Framework
The Game Controller framework (GameController.framework) lets you discover and configureMade-for-iPhone/iPod/iPad (MFi) game controller hardware in your app. Game controllers can be devicesconnected physically to an iOS device or connected wirelessly over Bluetooth. The Game Controller frameworknotifies your app when controllers become available and lets you specify which controller inputs are relevantto your app.
For more information about supporting game controllers, seeGame Controller Programming Guide.
Game Center Improvements
Game Center includes the following improvements:
Turn-based matches now support a new feature known asexchanges. Exchanges let players initiate actionswith other players, even when it is not their turn. You can use this feature to implement simultaneousturns, player chats, and trading between players.
The limit on per-app leaderboards has been raised from 25 to 100. You can also organize your leaderboardsusing aGKLeaderboardSetobject, which increases the limit to 500.
You can add conditions to challenges that define when the challenge has been met. For example, achallenge to beat a time in a driving game might stipulate that other players must use the same vehicle.
The framework has improved its authentication support and added other features to prevent cheating.For more information about how to use the new Game Center features, seeGame Center Programming Guide.
For information about the classes of the Game Kit framework, seeGame Kit Framework Reference.
Maps
The Map Kit framework (MapKit.framework) includes numerous improvements and features for apps thatuse map-based information. Apps that use maps to display location-based information can now take fulladvantage of the 3D map support found in the Maps app, including controlling the viewing perspectiveprogrammatically. Map Kit also enhances maps in your app in the following ways:
Overlays can be placed at different levels in the map content so that they appear above or below otherrelevant data.
You can apply an MKMapCameraobject to a map to add position, tilt, and heading information to itsappearance. The information you specify using the camera object imparts a 3D perspective on the map.
The MKDirectionsclass lets you ask for direction-related route information from Apple. You can usethat route information to create overlays for display on your own maps.
The MKGeodesicPolylineclass lets you create a line-based overlay that follows the curvature of theearth.
Apps can use the MKMapSnapshotterclass to capture map-based images.
The visual representation of overlays is now based on the MKOverlayRendererclass, which replaces
overlay views and offers a simpler rendering approach.
Apps can now supplement or replace a map’s existing tiles using theMKTileOverlayandMKTileOverlayRendererclasses.
For more information about the classes of the Map Kit framework, seeMap Kit Framework Reference.
AirDrop
AirDrop lets users share photos, documents, URLs, and other kinds of data with nearby devices. AirDrop supportis now built in to the existingUIActivityViewControllerclass. This class displays different options forsharing the content that you specify. If you are not yet using this class, you should consider adding it to yourinterface.
To receive files sent via AirDrop, do the following:
In Xcode, declare support for the document types your app supports. (Xcode adds the appropriate keysto your app’sInfo.plistfile.) The system uses this information to determine whether your app canopen a given file.
Implement the application:openURL:sourceApplication:annotation:method in your appdelegate. (The system calls this method when a new file is received.)
Files sent to your app are placed in theDocuments/Inboxdirectory of your app’s home directory. If you planto modify the file, you must move it out of this directory before doing so. (The system allows your app to readand delete files in this directory only.) Files stored in this directory are encrypted using data protection, so youmust be prepared for the file to be inaccessible if the device is currently locked.
For more information about using an activity view controller to share data, seeUIActivityViewController ClassReference.
Inter-App Audio
The Audio Unit framework (AudioUnit.framework) adds support for Inter-App Audio, which enables theability to send MIDI commands and stream audio between apps on the same device. For example, you mightuse this feature to record music from an app acting as an instrument or use it to send audio to another appfor processing. To vend your app’s audio data, publish a I/O audio unit (AURemoteIO) that is visible to otherprocesses. To use audio features from another app, use the audio component discovery interfaces in iOS 7.
For information about the new interfaces, see the framework header files. For general information about theinterfaces of this framework, seeAudio Unit Framework Reference.
Peer-to-Peer Connectivity
The Multipeer Connectivity framework (MultipeerConnectivity.framework) supports the discovery ofnearby devices and the direct communication with those devices without requiring Internet connectivity. Thisframework makes it possible to create multipeer sessions easily and to support reliable in-order data transmissionand real-time data transmission. With this framework, your app can communicate with nearby devices andseamlessly exchange data.
The framework provides programmatic and UI-based options for discovering and managing network services.Apps can integrate theMCBrowserViewControllerclass into their user interface to display a list of peerdevices for the user to choose from. Alternatively, you can use theMCNearbyServiceBrowserclass to lookfor and manage peer devices programmatically.
For more information about the interfaces of this framework, seeMultipeer Connectivity Framework Reference.
New Frameworks
iOS 7 includes the following new frameworks:
The Game Controller framework (GameController.framework) provides an interface for communicatingwithgame-relatedhardware;see“GameControllerFramework”(page11).
The Sprite Kit framework (SpriteKit.framework) provides support for sprite-based animations andgraphics rendering; see “Sprite Kit Framework”(page 11).
The Multipeer Connectivity framework (MultipeerConnectivity.framework) provides peer-to-peernetworking for apps; see“Peer-to-Peer Connectivity”(page 14).
The JavaScript Core framework (JavaScriptCore.framework) provides Objective-C wrapper classesfor many standard JavaScript objects. Use this framework to evaluate JavaScript code and parse JSONdata. For information about the classes of this framework, see the framework header files.
The Media Accessibility framework (MediaAccessibility.framework) manages the presentation ofclosed-captioned content in your media files. This framework works in conjunction with new settings thatlet the user enable the display of closed captions.
The Safari Services framework (SafariServices.framework) provides support for programmaticallyadding URLs to the user’s Safari reading list. For information about the class provided by this framework,see the framework header files.
Enhancements to Existing Frameworks
In addition to its new features, iOS 7 also includes significant enhancements, organized here by framework.For a complete list of new interfaces, seeiOS 7.0 API Diffs .
UIKit Framework
The UIKit framework (UIKit.framework) includes the following enhancements:
All UI elements have been updated to present the new look associated with iOS 7.
UIKit Dynamics lets you mimic real-world effects such as gravity in your animations; see“Dynamic Behaviors
for Views”(page 9).
Text Kit provides sophisticated text editing and display capabilities; see“Text Kit”(page 9).
The UIViewclass defines the following additions:
The tintColorproperty applies a tint color to both the view and its subviews. For information on howto apply tint colors, seeiOS 7 UI Transition Guide.
You can create keyframe-based animations using views. You can also make changes to your views andspecifically prevent any animations from being performed.
The UIViewControllerclass defines the following additions:
View controller transitions can be customized, driven interactively, or replaced altogether with ones you
designate.
View controllers can now specify their preferred status bar style and visibility. The system uses the providedinformation to manage the status bar style as new view controllers appear. You can also control how thisbehavior is applied using the UIViewControllerBasedStatusBarAppearancekey in your app’sInfo.plistfile.
The UIMotionEffectclass defines the basic behavior for motion effects, which are objects that definehow a view responds to device-based motion.
Collection views add support for intermediate layout transitions and invalidation contexts (invalidationcontexts help you improve the performance of your custom layout code). You can also apply UIKit Dynamicsto collection view layout attributes to animate the items in the collection.
The imageNamed:method ofUIImagesupports retrieving images stored in asset catalogs, which are away to manage and optimize assets that have multiple sizes and resolutions. You create asset catalogs inXcode.
There are methods on UIViewandUIScreenfor creating a snapshot of their contents. Generatingsnapshots using these new interfaces is significantly faster than rendering the view or screen contentsyourself.
Gesture recognizers can specify dependencies dynamically to ensure that one gesture recognizer failsbefore another is considered.
The UIKeyCommandclass wraps keyboard events received from an external hardware keyboard. Theseevents are delivered to the app’s responder chain for processing.
A UIFontDescriptorobject describes a font using a dictionary of attributes. Use font descriptors tointeroperate with other platforms.
The UIFontandUIFontDescriptorclasses support dynamic text sizing, which improves legibility fortext in apps. With this feature, the user controls the desired font size that all apps in the system shoulduse.
The UIActivityclass now supports new activity types, including activities for sending items via AirDrop,adding items to a Safari reading list, and posting content to Flickr, Tencent Weibo, and Vimeo.
The UIApplicationDelegateprotocol adds methods for handling background fetch behaviors.
The UIScreenEdgePanGestureRecognizerclass is a new gesture recognizer that tracks pan gestures
that originate near an edge of the screen.
UIKit adds support for running in a guided-access mode, which allows an app to lock itself to preventmodification by the user. This mode is intended for institutions such as schools, where users bring theirown devices but need to run apps provided by the institution.
State restoration now allows the saving and restoration of any object. Objects adopting theUIStateRestoringprotocol can write out state information when the app moves to the backgroundand have that state restored during subsequent launches.
Table views now support estimating the height of rows and other elements, which improves scrollingperformance.
You can now more easily configure aUISearchDisplayControllerobject to work with aUINavigationBarobject.
For information about the classes of this framework, seeUIKit Framework Reference.
Store Kit Framework
The Store Kit framework (StoreKit.framework) has migrated to a new receipt system that developers canuse to verify in-app purchases on the device itself. You can also use it to verify the app purchase receipt onthe server.
For more information about how to use this new receipt system, seeReceipt Validation Programming Guide.
Pass Kit Framework
The Pass Kit framework (PassKit.framework) includes new APIs for adding multiple passes in a singleoperation.
These new features were added to the pass file format:
New keys specify the expiration date for a pass.
You can specify that a pass is relevant only when it is in the vicinity of specific iBeacons.
New attributes control how a pass is displayed. You can group passes together, display links with customtext on the back of a pass, and control how time values are displayed on the pass.
You can now associate extra data with a pass. This data is available to your app but is not displayed to theuser.
You can designate which data detectors to apply to the fields of your passes.
For information about how to use Pass Kit in your app, see Passbook Programming Guide. For information
about the pass file format, seePassbook Package Format Reference.
OpenGL ES
iOS 7 adds support for OpenGL ES 3.0 and adds new features to OpenGL ES 2.0.
OpenGL ES 3.0 includes as core functionality the features of many extensions supported in OpenGL ES 2.0on iOS. But OpenGL ES 3.0 also adds new features to the OpenGL ES shading language and new corefunctionality that has never been available on mobile processors before, including multiple render targetsand transform feedback. You can use OpenGL ES 3 to more easily implement advanced renderingtechniques, such as deferred rendering.
To create an OpenGL ES 3 context on devices that support it, pass thekEAGLRenderingAPIOpenGLES3constant to theinitWithAPI:method.
OpenGL ES 2 adds the following new extensions:
The EXT_sRGBextension adds support for sRGB framebuffer operations.
The GL_EXT_pvrtc_sRGBextension adds support for sRGB texture data compressed in the PVRTCtexture compression format. (This extension is also supported in OpenGL ES 3.0).
The GL_EXT_draw_instancedandGL_EXT_instanced_arraysextensions can improve renderingperformance when your app draws multiple instances of the same object. You use a single call todraw instances of the same object. You add variation to each instance by specifying how fast eachvertex attribute advances or by referencing an ID for each instance in your shader.
Textures can be accessed in vertex shaders in both OpenGL ES 2.0 and 3.0. Query the value of theMAX_VERTEX_TEXTURE_IMAGE_UNITSattribute to determine the exact number of textures you canaccess. In earlier versions of iOS, this attribute always had a value of0.
For more information, see OpenGL ES Programming Guide for iOSandiOS Device Compatibility Reference.
Message UI Framework
In the Message UI framework, theMFMessageComposeViewControllerclass adds support for attachingfiles to messages.
For information about the new interfaces, see the framework header files. For information about the classesof this framework, seeMessage UI Framework Reference.
Media Player Framework
In the Media Player framework, theMPVolumeViewclass provides support for determining whether wirelessroutes such as AirPlay and Bluetooth are available for the user to select. You can also determine whether oneof these wireless routes is currently active. For information about the new interfaces, see the framework headerfiles.
For information about the classes of Media Player framework, seeMedia Player Framework Reference.
Map Kit Framework
The Map Kit framework (MapKit.framework) includes changes that are described in “Maps”(page 12).For information about the classes of this framework, seeMap Kit Framework Reference.
Image I/O Framework
The Image I/O framework (ImageIO.framework) now has interfaces for getting and setting image metadata.For information about the new interfaces, see the framework header files. For information about the classes
of this framework, see Image I/O Reference Collection.
iAd Framework
The iAd framework (iAd.framework) includes two extensions to other frameworks that make it easier toincorporate ads into your app’s content:
The framework introduces new methods on theMPMoviePlayerControllerclass that let you run adsbefore a movie.
The framework extends the UIViewControllerclass to make it easier to create ad-supported content.You can now configure your view controllers to display ads before displaying the actual content theymanage.
For information about the new interfaces, see the framework header files. For information about the classesof this framework, seeAd Support Framework Reference.
Game Kit Framework
The Game Kit framework (GameKit.framework) includes numerous changes, which are described in “GameCenter Improvements”(page 12).
For information about the classes of this framework, seeGame Kit Framework Reference.
Foundation Framework
The Foundation framework (Foundation.framework) includes the following enhancements:
The NSDataclass adds support for Base64 encoding.
The NSURLSessionclass is a new class for managing the acquisition of network-based resources. (Youcan use it to download content even when your app is suspended or not running.) This class serves as areplacement for theNSURLConnectionclass and its delegate; it also replaces theNSURLDownloadclassand its delegate.
The NSURLComponentsclass is a new class for parsing the components of a URL. This class supports theURI standard (rfc3986/STD66) for parsing URLs.
The NSNetServiceandNSNetServiceBrowserclasses support peer-to-peer discovery over Bluetoothand Wi-Fi.
The NSURLCredentialandNSURLCredentialStorageclasses let you create credentials with asynchronizable policy, and they provide the option of removing credentials with a synchronizable policyfrom iCloud.
The NSURLCache,NSURLCredentialStorage, andNSHTTPCookieStorageclasses now support theasynchronous processing of storage requests.
The NSCalendarclass supports new calendar types.
The NSProgressclass provides a general-purpose way to monitor the progress of an operation and report
that progress to other parts of your app that want to use it.
For information about the new interfaces, see the framework header files and Foundation release notes. Forgeneral information about the classes of this framework, seeFoundation Framework Reference.
Core Telephony Framework
The Core Telephony framework (CoreTelephony.framework) lets you get information about the type ofradio technology in use by the device. Apps developed in conjunction with a carrier can also authenticateagainst a particular subscriber for that carrier.
For information about the new interfaces, see the framework header files. For general information about theclasses of the Core Telephony framework, seeCore Telephony Framework Reference.
Core Motion Framework
The Core Motion framework (CoreMotion.framework) adds support for step counting and motion tracking.With step counting, the framework detects movements that correspond to user motion and uses that informationto report the number of steps to your app. Because the system detects the motion, it can continue to gatherstep data even when your app is not running. Alongside this feature, the framework can also distinguishdifferent types of motion, including different motions reflective of travel by walking, by running, or byautomobile. Navigation apps might use that data to change the type of directions they give to users.
For information about the classes of this framework, seeCore Motion Framework Reference.
Core Location Framework
The Core Location framework (CoreLocation.framework) supports region monitoring and ranging usingBluetooth devices. Region monitoring lets you determine whether the iOS device enters a specific area, andranging lets you determine the relative range of nearby Bluetooth devices. For example, an art museum mightuse region monitoring to determine whether a person is inside a particular gallery, and then place iBeaconsnear each painting. When the person is standing by a painting, the app would display information about it.
The framework also supports deferring the delivery of location updates until a specific time has elapsed or theuser has moved a minimum distance.
For general information about the classes of this framework, seeCore Location Framework Reference.
Core Foundation Framework
The Core Foundation framework (CoreFoundation.framework) now lets you schedule stream objects ondispatch queues.
For information about the new interfaces, see the framework header files. For general information about theinterfaces of this framework, seeCore Foundation Framework Reference.
Core Bluetooth Framework
The Core Bluetooth framework (CoreBluetooth.framework) includes the following enhancements:
The framework supports saving state information for central and peripheral objects and restoring thatstate at app launch time. You can use this feature to support long-term actions involving Bluetooth devices.
The central and peripheral classes now use anNSUUIDobject to store unique identifiers.You can now retrieve peripheral objects from a central manager synchronously.
For information about the classes of this framework, seeCore Bluetooth Framework ReferenceandCore BluetoothProgramming Guide.
AV Foundation Framework
The AV Foundation framework (AVFoundation.framework) includes the following enhancements:
The AVAudioSessionclass supports the following new behaviors:
Selecting the preferred audio input, including audio from built-in microphones
Multichannel input and output
The AVVideoCompositingprotocol and related classes let you support custom video compositors.
The AVSpeechSynthesizerclass and related classes provide speech synthesis capabilities.
The capture classes add support and interfaces for the following features:
Discovery of a camera’s supported formats and frame rates
High fps recording
Still image stabilization
Video zoom (true and digital) in recordings and video preview, including custom rampingReal-time discovery of machine-readable metadata (barcodes)
Autofocus range restriction
Smooth autofocus for capture
Sharing your app’s audio session during captureAccess to the clocks used during capture
Access to capture device authorization status (user must now grant access to the microphone andcamera)
Recommended settings for use with data outputs and asset writer
There are new metadata key spaces for supported ISO formats such as MPEG-4 and 3GPP, and improvedsupport for filtering metadata items when copying those items from source assets to output files usingtheAVAssetExportSessionclass.
The AVAssetWriterclass provides assistance in formulating output settings, and there are new levelconstants for H.264 encoding.
The AVPlayerLayerclass adds thevideoRectproperty, which you can use to get the size and positionof the video image.
The AVPlayerItemclass supports the following changes:
Asset properties can be loaded automatically when AVPlayerItemobjects are prepared for playback.
When you link your app against iOS 7 SDK, the behavior when getting the values of player itemproperties—such as theduration,tracks, orpresentationSizeproperties—is different fromthe behaviors in previous versions of iOS. The properties of this class now return a default value andno longer block your app if theAVPlayerItemobject is not yet ready to play. As soon as the playeritem’s status changes toAVPlayerItemStatusReadyToPlay, the getters reflect the actual valuesof the underlying media resource. If you use key-value observing to monitor changes to the properties,your observers are notified as soon as changes are available.
The AVPlayerItemLegibleOutputclass can process timed text from media files.
The AVAssetResourceLoaderDelegateprotocol now supports loading of arbitrary ranges of bytes
from a media resource.
For information about the new interfaces, see the framework header files. For general information about the
classes of this framework, seeAV Foundation Framework Reference.
Accelerate Framework
The Accelerate framework (Accelerate.framework) includes the following enhancements:
Improved support for manipulating Core Graphics data types
Support for working with grayscale images of 1, 2, or 4 bits per pixel
New routines for converting images between different formats and transforming image contentsSupport for biquad (IIR) operations
For information about the new interfaces, see the framework header files. For general information about thefunctions and types of this framework, seeAccelerate Framework Reference.
Objective-C
The Objective-C programming language has been enhanced to support modules, which yield faster builds andshorter project indexing times. Module support is enabled in all new projects created using Xcode 5. If youhave existing projects, you must enable this support explicitly by modifying your project’s Enable Modulessetting.
Deprecated APIs
From time to time, Apple adds deprecation macros to APIs to indicate that those APIs should no longer beused in active development. When a deprecation occurs, it is not an immediate end-of-life to the specified API.Instead, it is the beginning of a grace period for transitioning off that API and onto newer and more modernreplacements. Deprecated APIs typically remain present and usable in the system for a reasonable amount oftime past the release in which they were deprecated. However, active development on them ceases and theAPIs receive only minor changes—to accommodate security patches or to fix other critical bugs. DeprecatedAPIs may be removed entirely from a future version of the operating system.
As a developer, it is important that you avoid using deprecated APIs in your code as soon as possible. At aminimum, new code you write should never use deprecated APIs. And if you have existing code that usesdeprecated APIs, update that code as soon as possible. Fortunately, the compiler generates warnings wheneverit spots the use of a deprecated API in your code, and you can use those warnings to track down and removeall references to those APIs.
This release includes deprecations in the following technology areas:
The Map Kit framework includes deprecations for theMKOverlayViewclass and its various subclasses.The existing overlay views have been replaced with an updated set of overlay renderer objects that descendfrom theMKOverlayRendererclass. For more information about the classes of this framework, seeMapKit Framework Reference.
The Audio Session API in the Audio Toolbox framework is deprecated. Apps should use theAVAudioSessionclass in the AV Foundation framework instead.
The CLRegionclass in the Core Location framework is replaced by theCLCircularRegionclass. TheCLRegionclass continues to exist as an abstract base class that supports both geographic and beaconregions.
The UUIDproperty of theCBCentralclass is deprecated. To specify the unique ID of your central objects,use theidentifierproperty instead.
The Game Kit framework contains assorted deprecations intended to clean up the existing API and providebetter support for new features.
The UIKit framework contains the following deprecations:
The wantsFullScreenLayoutproperty ofUIViewControlleris deprecated. In iOS 7 and later,view controllers always support full screen layout.
UIColorobjects that provided background textures for earlier versions of iOS are gone.
Many drawing additions to theNSStringclass are deprecated in favor of newer variants.Thegethostuuidfunction in thelibsyscalllibrary is deprecated.
In iOS 7 and later, if you ask for the MAC address of an iOS device, the system returns the value02:00:00:00:00:00. If you need to identify the device, use the identifierForVendorproperty ofUIDeviceinstead. (Apps that need an identifier for their own advertising purposes should consider usingtheadvertisingIdentifierproperty ofASIdentifierManagerinstead.)
For a complete list of specific API deprecations, seeiOS 7.0 API Diffs.