Multitasking
Applications built using iOS SDK 4.0 or later (and running in iOS 4.0 and later) are not terminated when the user presses the Home button; instead, they shift to a background execution context. The multitasking support defined by UIKit helps your application transition to and from the background state smoothly.To preserve battery life, most applications are suspended by the system shortly after entering the background. A suspended application remains in memory but does not execute any code. This behavior allows an application to resume quickly when it is relaunched without consuming battery power in the meantime. However, applications may be allowed to continue running in the background for the following reasons:
- 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.
Printing
Introduced in iOS 4.2, the UIKit printing support allows applications to send content wirelessly to nearby printers. For the most part, UIKit does all of the heavy lifting associated with printing. It manages the printing interfaces, works with your application to render the printable content, and handles the scheduling and execution of print jobs on the printer.Print jobs submitted by your application are handed off to the printing system, which manages the actual printing process. Print jobs from all applications on a device are queued and printed on a first-come, first-served basis. Users can get the status of print jobs from the Print Center application and can even use that application to cancel print jobs. All other aspects of printing are handled for you automatically by the system.
Data Protection
Introduced in iOS 4.0, data protection allows applications that work with sensitive user data to take advantage of the built-in encryption available on some devices. When your application designates a specific 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 be designed to secure the data at creation time and to be prepared for access changes when the user locks and unlocks the device.
Apple Push Notification Service
Introduced in iOS 3.0, the Apple Push Notification Service provides a way to alert users of new information, even when your application is not actively running. Using this service, you can push text notifications, add a badge to your application icon, or trigger audible alerts on user devices at any time. 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 iOS applications. First, the application must request the delivery of notifications and process the notification data once it is delivered. 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.
Local Notifications
Introduced in iOS 4.0, local notifications complement the existing push notification mechanism by giving applications an avenue for generating the notifications locally instead of relying on an external server. Applications running in the background 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.
Gesture Recognizers
Introduced in iOS 3.2, gesture recognizers are objects that you attach to views and use to detect common types of gestures such as swipes and pinches. After attaching a gesture recognizer to your view, you tell it what action to perform when the gesture occurs. The gesture recognizer object then tracks the raw touch events and applies the system-defined heuristics for what the given gesture should be. Without gesture recognizers, you must do all this work yourself, which can be quite complicated.UIKit 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 UIKit-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
No comments:
Post a Comment