Short information about the first iphone development
The
The call to
In an iOS app, a window object provides a container for the app’s visible content, helps deliver events to app objects, and helps the app respond to changes in the device’s orientation. The window itself is invisible.
The call to
When the app starts,
A view controller is an object that manages an area of content and also manages a single view hierarchy.
The initial view controller is simply the first view controller that gets loaded when an app starts.
A view is an object that draws content in a rectangular area of the screen and handles events caused by the user’s touches.
A view can also contain other views, which are called subviews. When you add a subview to a view, the containing view is called the parent view and its subview is called a child view. The parent view, its child views (and their child views, if any) form a view hierarchy.
A scene represents a view controller, and a segue represents a transition between two scenes.
The first responder is a dynamic placeholder that represents the object that should be the first to receive various events while the app is running. These events include editing-focus events (such as tapping a text field to bring up the keyboard), motion events (such as shaking the device), and action messages (such as the message a button sends when the user taps it), among others. You won’t be doing anything with the first responder in this tutorial.
Note:
An outlet describes a connection between two objects. When you want an object (such as the view controller) to communicate with an object that it contains (such as the text field), you designate the contained object as an outlet. When the app runs, the outlet you create in Xcode is restored, which allows the objects to communicate with each other at runtime.
Note:
@autoreleasepool
statement supports the Automatic
Reference Counting (ARC) system. ARC provides automatic object-lifetime
management for your app, ensuring that objects remain in existence for
as long as they're needed and no longer.The call to
UIApplicationMain
creates an instance of the UIApplication
class and an instance of the app delegate (in this tutorial, the app delegate is HelloWorldAppDelegate
, which is provided for you by the Single View template). The main job of the app delegate
is to provide the window into which your app’s content is drawn. The
app delegate can also perform some app configuration tasks before the
app is displayed. (Delegation is a design pattern in which one object acts on behalf of, or in coordination with, another object.)In an iOS app, a window object provides a container for the app’s visible content, helps deliver events to app objects, and helps the app respond to changes in the device’s orientation. The window itself is invisible.
The call to
UIApplicationMain
also scans the app’s Info.plist
file. The Info.plist
file is a property list (that is, a structured list of key-value pairs)
that contains information about the app such as its name and icon.When the app starts,
MainStoryboard.storyboard
is loaded and the initial view controller is instantiated from it. A view controller is an object that manages an area of content and also manages a single view hierarchy.
The initial view controller is simply the first view controller that gets loaded when an app starts.
A view is an object that draws content in a rectangular area of the screen and handles events caused by the user’s touches.
A view can also contain other views, which are called subviews. When you add a subview to a view, the containing view is called the parent view and its subview is called a child view. The parent view, its child views (and their child views, if any) form a view hierarchy.
A scene represents a view controller, and a segue represents a transition between two scenes.
The first responder is a dynamic placeholder that represents the object that should be the first to receive various events while the app is running. These events include editing-focus events (such as tapping a text field to bring up the keyboard), motion events (such as shaking the device), and action messages (such as the message a button sends when the user taps it), among others. You won’t be doing anything with the first responder in this tutorial.
Note:
IBAction
is a special keyword that is used to tell Xcode to treat a method as an action for target-action connections. IBAction
is defined to void
.An outlet describes a connection between two objects. When you want an object (such as the view controller) to communicate with an object that it contains (such as the text field), you designate the contained object as an outlet. When the app runs, the outlet you create in Xcode is restored, which allows the objects to communicate with each other at runtime.
Note:
IBOutlet
is a special keyword that
is used only to tell Xcode to treat the object as an outlet. It’s
actually defined as nothing so it has no effect at compile time.