What is iPad All About?
With iPad devices, you now have an opportunity to create Multi-Touch applications on a larger display than previously available. The 1024 x 768 pixel screen provides much more room to display content, or provide greater detail for your existing content. And the addition of new interface elements in iPhone OS 3.2 enable an entirely new breed of applications.
The size and capabilities of iPad mean that it is now possible to create a new class of applications for a portable device. The increased screen size gives you the space you need to present almost any kind of content. The Multi-Touch interface and support for physical keyboards enables diverse modes of interaction, ranging from simple gesture-driven interactions to content creation and substantial text input.
The increased screen size also makes it possible to create a new class of immersive applications that replicate real-world objects in a digital form. For example, the Contacts and Calendar applications on iPad look more like the paper-based address book and calendar you might have on your desk at home. These digital metaphors for real-life objects provide a more natural and familiar experience for the user and can make your applications more compelling to use. But because they are digital, you can go beyond the limitations of the physical objects themselves and create applications that enable greater productivity and convenience.
iPhone Applications. iPhone applications are optimized to run on iPhone and iPod touch. These applications run on iPad in their original resolution or can be optionally set to be pixel- doubled to accommodate for the larger display.
iPad Applications. iPhone SDK 3.2 supports the development of iPad applications that are optimized to take advantage of iPad features, but run only on iPad.
Universal Applications. iPhone SDK 3.2 supports the development of Universal applications. A Universal app is optimized to run on all iPhone OS devices—itʼs essentially an iPhone app and an iPad app built as a single binary.
(New) An application’s interface should support all landscape and portrait orientations. This behavior differs slightly from the iPhone, where running in both portrait and landscape modes is not required. For more information, see “Designing for Multiple Orientations.”
In addition to the standard frameworks you use for drawing, iPhone OS 3.2 introduces some new features for generating rendered content. The UIBezierPath class is an Objective-C wrapper around a Core Graphics path that makes creating vector-based paths easier. And if you use PDF content, there are now functions that you can use to generate PDF data and save it to a file or data object.
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.
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.
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.
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.
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
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.
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.
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.
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:
An application indicates that it wants to share files by including the UIFileSharingEnabled key in its Info.plist file.
It puts whatever files it wants to share in its Documents/Shared directory.
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.
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.
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.)