본문 바로가기

관심사

iOS Overview

728x90
반응형

iOS Overview

iOS comprises the operating system and technologies that you use to run applications natively on devices, such as iPad, iPhone, and iPod touch. Although it shares a common heritage and many underlying technologies with Mac OS X, iOS was designed to meet the needs of a mobile environment, where users’ needs are slightly different. If you have previously developed applications for Mac OS X, you will find many familiar technologies, but you’ll also find technologies that are available only on iOS, such as the Multi-Touch interface and accelerometer support.

The iOS SDK contains the code, information, and tools you need to develop, test, run, debug, and tune applications for iOS. The Xcode tools provide the basic editing, compilation, and debugging environment for your code. Xcode also provides the launching point for testing your applications on an iOS device, and in iOS Simulator—a platform that mimics the basic iOS environment but runs on your local Macintosh computer.

This article provides a high-level overview of the basic features found in iOS, to help orient you to the platform. You’ll find other articles in the iOS Dev Center to help get you up to speed quickly and to help you understand the basic process for creating iOS applications. You should use these articles to help guide your learning path for iOS.

image: Art/overview_iphonetouch.jpg

Contents:

iOS Technology Layers
Writing Code for iOS
Where to Start


iOS Technology Layers

The kernel in iOS is based on a variant of the same basic Mach kernel that is found in Mac OS X. On top of this kernel are the layers of services that are used to implement applications on the platform. Figure 1-1 shows a high-level overview of these layers.

Figure 1-1  iOS technology layers

This layering gives you choices when it comes to implementing your code. For example, the Core OS and Core Services layers contain the fundamental interfaces for iOS, including those used for accessing files, low-level data types, Bonjour services, network sockets, and so on. These interfaces are mostly C-based and include technologies such as Core Foundation, CFNetwork, SQLite, and access to POSIX threads and UNIX sockets among others.

As you move into the upper layers, you find more advanced technologies that use interfaces based on a mixture of C and Objective-C. For example, the Media layer contains the fundamental technologies used to support 2D and 3D drawing, audio, and video. This layer includes the C-based technologies OpenGL ES, Quartz, and Core Audio. It also contains Core Animation, which is an advanced Objective-C based animation engine.

In the Cocoa Touch layer, most of the technologies use Objective-C. The frameworks at these layers provide the fundamental infrastructure used by your application. For example, the Foundation framework provides object-oriented support for collections, file management, network operations, and more. The UIKit framework provides the visual infrastructure for your application, including classes for windows, views, controls, and the controllers that manage those objects. Other frameworks at this level give you access to the user’s contact and photo information and to the accelerometers and other hardware features of the device.

The starting point for any new project is the Cocoa Touch layer, and the UIKit framework in particular. When deciding what additional technologies to use, you should start with frameworks in the higher-level layers. The higher-level frameworks make it easy to support standard system behaviors with the least amount of effort on your part. You should fall back to the lower-level frameworks only if you want to implement custom behavior that is not provided at a higher level.

For a more detailed overview of the technologies in iOS, see iOS Technology Overview.

Writing Code for iOS

The iOS SDK supports the creation of graphically-oriented applications that run natively in iOS. The applications you create reside on the user’s Home screen, along with the other system applications, such as Photos, Weather, and Clock. While running, your application occupies the entire screen and is the focus of the user’s attention. There is no concept of separate document windows for displaying content. Instead, all of the application’s data is displayed in a single window.

The event-handling model in iOS represents a significant departure from traditional desktop applications. Instead of relying on the traditional mouse and keyboard events, iOS introduces the idea of touch events. A touch event can occur at any time and in combination with one or more additional touch events. Touches can be used to detect simple interactions with content, such as selecting or dragging items, or they can be used to detect complex gestures and interactions, such as swipes or the pinch-open and pinch-close gestures (used, for example, to zoom in and out in the Photos application).

Beyond considering the basic structure of your application, you need to think about how users will actually use it. iOS applications should be clean, and focused on what the user needs in the moment. Remember that users who are on-the-go want to get at information quickly and not spend a lot of time looking through several layers of screens. Providing a simple layout that highlights the key information the user needs is important. For games and other fun applications, you should also consider how the users might want to interact with your application and take advantage of technologies such as the accelerometers and camera where appropriate.

As you start development, the frameworks you want to use initially are the Foundation and UIKit frameworks. These frameworks provide the key services used by all iOS applications. As you refine your application, you should investigate the other frameworks in the system to see what services they offer. The documentation for each framework includes links to relevant conceptual materials to help you learn more about how to use that framework.

For information about the Foundation and UIKit frameworks, see Foundation Framework Reference and UIKit Framework Reference.

Where to Start

Creating simple applications that run on iOS is relatively easy with the built-in project templates provided by Xcode, but creating applications that do something useful and look nice requires you to spend some time reading through the available documentation. At a minimum, you should take the time to read through the other orientation articles in the iOS Dev Center, which explore the tools and process for creating applications.

If you are completely new to iOS and to Mac OS X, taking the time to understand the basic design patterns and conventions of iOS is critical to writing code for the platform. Applications operate best in iOS when they take advantage of the power the frameworks provide. If you spend time trying to work around the basic framework behaviors, you may find creating your application much more difficult than simply learning the basic design patterns in use. The basic information that every iPhone developer needs to know is in Cocoa Fundamentals Guide. This document covers the basics of the Objective-C language and the programming conventions and design patterns used by UIKit and many other system frameworks.

Once you understand the basic conventions you use to create iOS applications, you can refer to iOS Application Programming Guide for specific details on the development process. This book provides key conceptual and task-based information on how to write iPhone applications, including examples of how to display a user interface, handle events, and take advantage of key iOS features. It also describes the overall development process and explains how you use Xcode to build and run your applications.

In addition to iOS Application Programming Guide, you should also look through the available sample code. iOS ships with a number of full-featured samples that show you how to use the available technologies to create real-world applications. You can use these samples as a starting point for your own applications or you can look at them to learn more about how you use specific features.


반응형