Create your first iOS program

Source: Internet
Author: User

First, the preparatory work

1. Integrated Usage Basics: Class object property array Dictionary character protocol proxy block

2. Logical Thinking

3. Build interface: System-provided Uikit define your own style of control

1?? Uilable Uitextfield Uitextview

2?? Uiimageview UIView UIButton UILabel

3?? UITableView Uiscrollview Uicollectionview

4. Data acquisition and storage

1?? Multithreading
2?? Internet
3?? Database

5. Self-thinking and learning

Second, how to create an iOS program

1. Use the system's template to create the program:

Xcode->ios module, single view app

2. Accelerator keys for the simulator

Commond + SHIFT + H back to main interface

Commond + SHIFT + HH Open All programs running in the background

Commond + SHIFT + K Toggle Keyboard

Commond + Left and right key toggle screen

Commond + up and down keys to adjust volume

3. The file provided by the program created by default introduction

assets.xcassets: Storing picture resources

Main.storyboard: story version, provides a quick way to build an interface-drag controls, and interface switching relationships

Launchscreen.storyboard: automatically disappears after a few seconds

info.plist:app configuration file, configure app name, configure start

Appdelegate. H.M the agent of the program, the system is responsible for loading the program's hardware requirements, but the program will show the app how to display the interface or some events in the end how to deal with the related things to the Appdelegate class

Note: 1?? one application has and only one program agent

2?? Appdelegate start-up interface for configuring programs

3?? Monitoring the events of the system   

    Back to Backstage Applic!tiondidenterbackground

Resume Running Applic!tiondidbecomeactive

Program Jump OpenURL

The program was interrupted applicationwillterminate

Remote Message Didregisterforremotenotificationswithdevicetoken

System memory Tight Applicationdidreceivememorywarning

4?? viewcontroller:uiviewcontroller Invisible Controller Control display of each interface

4. Use Didfinishlaunchingwithoptions method to configure the program to load

Cancels the system default configuration (default load Main.storyboard)

Third, what is the interface-controller

1.UIViewController View Controller, one controller manages an interface

2. Content added in the interface is a view child control

3. Controller is not visible, the controller provides a UIView view by default, to manage or display the sub-view of this interface, so adding a sub-view to an interface, is actually to add a child view on the view of this interface

4. Interface implementation process & interface life cycle

-init Create and initialize this interface object: There is an interface object.

-loadview Load the default view 1. This interface does not have View 2. But I don't want to use it. system default ( not normally used)

-viewdidload Loading interface default provides the layout of the View interface ( the general code is written here )

The-viewwillappear interface will display

The-viewdidappear interface has been displayed.

-viewwilldisappear interface is about to disappear

The-viewdiddisappear interface has disappeared.

5.UIView Properties and methods
-View-see controls are views, all uikit are directly or indirectly inherited from the uiview-view is a rectangular area rendering GPU

-frame: x y width height of the placed control relative to the parent view

Removefromsuperview to remove a view from the parent view

Exchangesubviewatindex: withsubviewatindex: Swapping position hierarchies for two views

Addsubview Add a sub-view outermost layer

Bringsubviewtofront move a child view to the front

Sendsubviewtoback move a child view to the last

Create your first iOS program

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.