The iPhone iOS 4 Cocoa Touch Layer

From Techotopia
Revision as of 19:42, 24 March 2011 by Neil (Talk | contribs) (UIKit Framework (UIKit.framework))

Jump to: navigation, search
PreviousTable of ContentsNext
The iOS 4 Architecture and SDK FrameworksThe iPhone iOS 4 Media Layer


<google>BUY_IOS4</google>

The Cocoa Touch layer sits at the top of the iOS stack and contains the frameworks that are most commonly used by iPhone application developers. Cocoa Touch is primarily written in Objective-C, is based on the standard Mac OS X Cocoa API (as found on Apple desktop and laptop computers) and has been extended and modified to meet the needs of the iPhone. The Cocoa Touch layer provides the following frameworks for iPhone app development:


Contents


UIKit Framework (UIKit.framework)

The UIKit framework is a vast and feature rich Objective-C based programming interface. It is, without question, the framework with which you will spend most of your time working. Entire books could, and probably will, be written about the UIKit framework alone. Some of the key features of UIKit are as follows:

  • User interface creation and management (text fields, buttons, labels, colors, fonts etc)
  • Application lifecycle management
  • Application event handling (e.g. touch screen user interaction)
  • Multitasking
  • Wireless Printing
  • Data protection via encryption
  • Cut, copy, and paste functionality
  • Web and text content presentation and management
  • Data handling
  • Inter-application integration
  • Push notification in conjunction with Push Notification Service
  • Local notifications (a mechanism whereby an application running in the background can gain the user’s attention)
  • Accessibility
  • Accelerometer, battery, proximity sensor, camera and photo library interaction.
  • Touch screen gesture recognition
  • File sharing (the ability to make application files stored on the device available via iTunes)
  • Blue tooth based peer to peer connectivity between devices
  • Connection to external displays

To get a feel for the richness of this framework it is worth spending some time browsing Apple’s UIKit reference material which is available online at:

http://developer.apple.com/library/ios/#documentation/UIKit/Reference/UIKit_Framework/index.html

Map Kit Framework (MapKit.framework)

<google>ADSDAQBOX_FLOW</google> If you have spent any appreciable time with an iPhone then the chances are you have needed to use the Maps application more than once, either to get a map of a specific area or to generate driving directions to get you to your intended destination. The Map Kit framework provides a programming interface that enables you to build map based capabilities into your own applications. This allows you to, amongst other things, display scrollable maps for any location, display the map corresponding to the current geographical location of the device and annotate the map in a variety of ways.


Push Notification Service

The Push Notification Service allows applications to notify users of an event even when the application is not currently running on the device. Since the introduction of this service it has most commonly been used by news based applications. Typically when there is breaking news the service will generate a message on the device with the news headline and provide the user the option to load the corresponding news app to read more details. This alert is typically accompanied by an audio alert and vibration of the device. This feature should be used sparingly to avoid annoying the user with frequent interruptions.

Message UI Framework (MessageUI.framework)

The Message UI framework provides everything you need to allow users to compose and send email messages from within your application. In fact, the framework even provides the user interface elements through which the user enters the email addressing information and message content. Alternatively, this information can be pre-defined within your application and then displayed for the user to edit and approve prior to sending.

Address Book UI Framework (AddressUI.framework)

Given that a key function of the iPhone is as a communications device and digital assistant it should not come as too much of a surprise that an entire framework is dedicated to the integration of the address book data into your own applications. The primary purpose of the framework is to enable you to access, display, edit and enter contact information from the iPhone address book from within your own application.

Game Kit Framework (GameKit.framework)

The Game Kit framework provides peer-to-peer connectivity and voice communication between multiple devices and users allowing those running the same app to interact. When this feature was first introduced it was anticipated by Apple that it would primarily be used in multi-player games (hence the choice of name) but the possible applications for this feature clearly extend far beyond games development.

iAd Framework (iAd.framework)

The purpose of the iAd Framework is to allow developers to include banner advertising within their applications. All advertisements are served by Apple’s own ad service.

Event Kit UI Framework

The Event Kit UI framework was introduced in iOS 4 and is provided to allow the calendar events to be accessed and edited from within an application.


<google>BUY_IOS4_BOTTOM</google>


PreviousTable of ContentsNext
The iOS 4 Architecture and SDK FrameworksThe iPhone iOS 4 Media Layer