29.1.10

What's New in iPhone OS: iPhone OS 3.2

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.

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.

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.

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 share files with the user can now do so using the file-sharing support in iPhone OS 3.2. Here’s how it works:

  1. An application indicates that it wants to share files by including the UIFileSharingEnabled key in its Info.plist file.

  2. It puts whatever files it wants to share in its Documents/Shared directory.

  3. When the device is plugged into the user’s computer, a mount point is added to the system and the contents of any shared directories appear on the user’s desktop.

  4. Users can modify the contents of this directory freely by copying files out, deleting files, or dragging new files in.

Applications that support file sharing should recognize when files have been added to the directory or removed and respond appropriately. For example, if the user added files to the directory, your iPad application might make those files available from its interface. You should never expect the user to go searching for files in this directory, nor should your application rely on any files being in this directory. It is strictly for sharing files with the user’s computer.

For detailed information about how to support file sharing in your own applications, see The Core Application in iPad Programming Guide

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.

Complimenting 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 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 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:

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:

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.

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:

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/.



Last updated: 2010-01-22

For those of you without dev accounts...take a peek.

The placeholder for geolocation is particularly interesting...as is the warning in new Apple developer agreement that location data may not be secure.

Posted via web from Jen's Posterous

No comments: