html5中文学习网

您的位置: 首页 > ios » 正文

iOS框架总览

[ ] 已经帮助:人解决问题

Survey the Major Frameworks

A framework is a directory that includes a shared library, header files to access the code stored in that library, and other resources such as image and sound files. A shared library defines functions and methods that apps can call.4RmHTML5中文学习网 - HTML5先行者学习网

iOS provides many frameworks that you can use in app development. To use a framework, add it to your project so your app can link to it. Most apps link to the Foundation, UIKit, and Core Graphics frameworks. Depending on which template you choose for your app, other frameworks might also be included. You can always add additional frameworks to your project if the core set of frameworks does not meet your app’s requirements.4RmHTML5中文学习网 - HTML5先行者学习网

bullet
To look at the frameworks included in HelloWorld.xcodeproj . . .
  1. Open the HelloWorld.xcodeproj project in Xcode (if it’s not already open). You created this project earlier in theYour First iOS App tutorial.4RmHTML5中文学习网 - HTML5先行者学习网

  2. Open the Frameworks folder in the project navigator by clicking the disclosure triangle next to it.4RmHTML5中文学习网 - HTML5先行者学习网

    You should see UIKit.frameworkFoundation.framework, and CoreGraphics.framework.4RmHTML5中文学习网 - HTML5先行者学习网

  3. You can view the header files in a framework by clicking the disclosure triangle next to the framework and then clicking the disclosure triangle next to the Headers folder.4RmHTML5中文学习网 - HTML5先行者学习网

Each framework belongs to a layer of the iOS system. Each layer builds on the ones below it. Use higher-level frameworks instead of lower-level frameworks whenever possible. Higher-level frameworks provide object-oriented abstractions for lower-level constructs.4RmHTML5中文学习网 - HTML5先行者学习网

image: ../Art/framework_layer.png4RmHTML5中文学习网 - HTML5先行者学习网

iOS Apps Are Based on the Foundation and UIKit Frameworks

When you begin programming, you mainly use the Foundation and UIKit frameworks because they cover most of your app development needs.4RmHTML5中文学习网 - HTML5先行者学习网

 4RmHTML5中文学习网 - HTML5先行者学习网

The Foundation Framework Provides Basic System Services for All Apps

Your apps, as well as UIKit and other frameworks, are built on the Foundation framework infrastructure. The Foundation framework provides Objective-C wrappers for many of the features in the Core Foundation framework (which is C-based).4RmHTML5中文学习网 - HTML5先行者学习网

Use Foundation to:4RmHTML5中文学习网 - HTML5先行者学习网

  • Create and manage collections such as arrays and dictionaries.4RmHTML5中文学习网 - HTML5先行者学习网

  • Access images and other resources stored in your app.4RmHTML5中文学习网 - HTML5先行者学习网

  • Create and manage strings.4RmHTML5中文学习网 - HTML5先行者学习网

  • Post and observe notifications.4RmHTML5中文学习网 - HTML5先行者学习网

  • Create date and time objects.4RmHTML5中文学习网 - HTML5先行者学习网

  • Automatically discover devices on IP networks.4RmHTML5中文学习网 - HTML5先行者学习网

  • Manipulate URL streams.4RmHTML5中文学习网 - HTML5先行者学习网

  • Perform code asynchronously.4RmHTML5中文学习网 - HTML5先行者学习网

You already used the Foundation framework in Your First iOS App. For example, you used an instance of the NSStringclass to store the user’s input in userName. You also used the Foundation instance method initWithFormat: to create the greeting string.4RmHTML5中文学习网 - HTML5先行者学习网

 4RmHTML5中文学习网 - HTML5先行者学习网

The UIKit Framework Provides Classes to Create a Touch-Based User Interface

All iOS apps are based on UIKit—you can’t ship an app without this framework. UIKit provides the infrastructure for drawing to the screen, handling events, and creating common user-interface elements. UIKit also organizes a complex app by managing the content that is displayed onscreen.4RmHTML5中文学习网 - HTML5先行者学习网

Use UIKit to:4RmHTML5中文学习网 - HTML5先行者学习网

  • Construct and manage your user interface.4RmHTML5中文学习网 - HTML5先行者学习网

  • Handle touch and motion-based events.4RmHTML5中文学习网 - HTML5先行者学习网

  • Present text and web content.4RmHTML5中文学习网 - HTML5先行者学习网

  • Optimize your app for multitasking.4RmHTML5中文学习网 - HTML5先行者学习网

  • Create custom user-interface elements.4RmHTML5中文学习网 - HTML5先行者学习网

In Your First iOS App Tutorial, you used UIKit. When you examined how an app starts up, you saw that theUIApplicationMain function creates an instance of the UIApplication class, which handles incoming user events. You implemented the UITextFieldDelegate protocol in order to dismiss the keyboard when the user taps the Done key. In fact, you used UIKit to create your entire interface with the UITextFieldUILabel, and UIButton classes.4RmHTML5中文学习网 - HTML5先行者学习网

 4RmHTML5中文学习网 - HTML5先行者学习网

Other Important Frameworks You Should Know About

The Core Data, Core Graphics, Core Animation, and OpenGL ES frameworks are advanced technologies. Although these frameworks are important for app development, they require time to learn and master.4RmHTML5中文学习网 - HTML5先行者学习网

 4RmHTML5中文学习网 - HTML5先行者学习网

The Core Data Framework Manages the Data Model of an App

Core Data provides object-graph management. With Core Data, you create model objects, known as managed objects. You manage relationships between those objects and make changes to the data through the framework. Core Data takes advantage of the built-in SQlite technology to store and manage data efficiently.4RmHTML5中文学习网 - HTML5先行者学习网

Use Core Data to:4RmHTML5中文学习网 - HTML5先行者学习网

  • Save and retrieve objects from storage.4RmHTML5中文学习网 - HTML5先行者学习网

  • Support basic undo/redo.4RmHTML5中文学习网 - HTML5先行者学习网

  • Validate property values automatically.4RmHTML5中文学习网 - HTML5先行者学习网

  • Filter, group, and organize data in memory.4RmHTML5中文学习网 - HTML5先行者学习网

  • Manage results in a table view with [NSFetchedResultsController].4RmHTML5中文学习网 - HTML5先行者学习网

  • Support document-based applications.4RmHTML5中文学习网 - HTML5先行者学习网

 4RmHTML5中文学习网 - HTML5先行者学习网

The Core Graphics Framework Helps You Create Graphics

High-quality graphics are an important part of all iOS applications. The simplest and most efficient way to create graphics in iOS is to use prerendered images with the standard views and controls of the UIKit framework and let iOS do the drawing. When you need to create complex graphics, Core Graphics provides a low-level graphics library to help you. Core Graphics, also known as Quartz, handles native 2D vector- and image-based rendering.4RmHTML5中文学习网 - HTML5先行者学习网

Use Core Graphics to:4RmHTML5中文学习网 - HTML5先行者学习网

  • Make path-based drawings.4RmHTML5中文学习网 - HTML5先行者学习网

  • Use anti-aliased rendering.4RmHTML5中文学习网 - HTML5先行者学习网

  • Add gradients, images, and colors.4RmHTML5中文学习网 - HTML5先行者学习网

  • Use coordinate-space transformations.4RmHTML5中文学习网 - HTML5先行者学习网

  • Create, display, and parse PDF documents.4RmHTML5中文学习网 - HTML5先行者学习网

 4RmHTML5中文学习网 - HTML5先行者学习网

Core Animation Allows You to Make Advanced Animations and Visual Effects

UIKit provides animations that are built on top of the Core Animation technology. If you need advanced animations beyond the capabilities of UIKit, you can use Core Animation directly. The Core Animation interfaces are contained in the Quartz Core framework. With Core Animation, you create a hierarchy of layer objects that you manipulate, rotate, scale, transform, and so forth. By using Core Animation’s familiar view-like abstraction, you can create dynamic user interfaces without having to use low-level graphics APIs like OpenGL ES.4RmHTML5中文学习网 - HTML5先行者学习网

Use Core Animation to:4RmHTML5中文学习网 - HTML5先行者学习网

  • Create custom animations.4RmHTML5中文学习网 - HTML5先行者学习网

  • Add timing functions to graphics.4RmHTML5中文学习网 - HTML5先行者学习网

  • Support key frame animation.4RmHTML5中文学习网 - HTML5先行者学习网

  • Specify graphical layout constraints.4RmHTML5中文学习网 - HTML5先行者学习网

  • Group multiple-layer changes into an atomic update.4RmHTML5中文学习网 - HTML5先行者学习网

 4RmHTML5中文学习网 - HTML5先行者学习网

The OpenGL ES Framework Provides Tools for 2D and 3D Drawing

OpenGL ES supports basic 2D and 3D drawing. Apple’s implementation of the OpenGL ES standard works closely with the device hardware to provide high frame rates for full-screen game-style applications.4RmHTML5中文学习网 - HTML5先行者学习网

Use OpenGL ES to:4RmHTML5中文学习网 - HTML5先行者学习网

  • Create 2D and 3D graphics.4RmHTML5中文学习网 - HTML5先行者学习网

  • Make more complex graphics such as data visualization, flight simulation, or video games.4RmHTML5中文学习网 - HTML5先行者学习网

  • Access underlying graphics hardware.4RmHTML5中文学习网 - HTML5先行者学习网

 4RmHTML5中文学习网 - HTML5先行者学习网

Add Other Frameworks to Your Project as Needed

There are many more frameworks you can use in your app. When you decide that you need to use a framework that is not already included, add the framework to your project so your app can link to it.4RmHTML5中文学习网 - HTML5先行者学习网

image: ../Art/project_editor.jpg4RmHTML5中文学习网 - HTML5先行者学习网

bullet
To link the HelloWorld.xcodeproj to another framework . . .
  1. Open the HelloWorld.xcodeproj project in Xcode (if it’s not already open).4RmHTML5中文学习网 - HTML5先行者学习网

  2. Click the HelloWorld project in the project navigator to show the project editor.4RmHTML5中文学习网 - HTML5先行者学习网

  3. Specify HelloWorld as the target to which you want to add a framework by clicking HelloWorld in the Targets list.4RmHTML5中文学习网 - HTML5先行者学习网

  4. Click Build Phases at the top of the project editor.4RmHTML5中文学习网 - HTML5先行者学习网

  5. Open the Link Binary With Libraries section by clicking the disclosure triangle.4RmHTML5中文学习网 - HTML5先行者学习网

  6. Click the Add (+) button to add a framework.4RmHTML5中文学习网 - HTML5先行者学习网

  7. Select a framework from the list and click Add.4RmHTML5中文学习网 - HTML5先行者学习网

For a complete list of the frameworks, or to learn more about them, see the iOS Technology Overview.4RmHTML5中文学习网 - HTML5先行者学习网

参考资料

https://developer.apple.com/library/ios/#referencelibrary/GettingStarted/RoadMapiOS/Frameworks/SurveytheMajorFrameworks/SurveytheMajorFrameworks/SurveytheMajorFrameworks.html
(责任编辑:)
推荐书籍
推荐资讯
关于HTML5先行者 - 联系我们 - 广告服务 - 友情链接 - 网站地图 - 版权声明 - 人才招聘 - 帮助