iOS Basis
iOS Basis
•Company Identifier: Your company identifier, if you have one. If you don’t, use
com.example.
Go ahead and look through the menu to see what other hardware options are
available in iOS Simulator.
Alternatively, you can choose Product > Run (or press Command-R).
If this is the first time you’re running an app, Xcode asks whether you’d like to enable
developer mode on your Mac. Developer mode allows Xcode access to certain
debugging features without requiring you to enter your password each time. Decide
whether you’d like to enable developer mode and follow the prompts. If you choose
not to enable it, you may be asked for your password later on.
The outline view—which appears on the left side of the canvas—lets you see a
hierarchical representation of the objects in your storyboard.
The Controller
After you lay out your user interface, you need to let users interact with it. This is
where controllers come in. Controllers support your views by responding to user
actions and populating the views with content. Controller objects are a conduit
through which views learn about changes in the data model, and vice versa. Views are
notified of changes in model data through the app’s controllers, and controllers
communicate user-initiated changes—for example, text entered in a text field—to
model objects. Whether they’re responding to user actions or defining navigation,
controllers implement your app’s behavior.
Actions
An action is a piece of code that’s linked to some kind of event that can occur in your
app. When that event takes place, the code gets executed. You can define an action to
accomplish anything from manipulating a piece of data to updating the user interface.
You use actions to drive the flow of your app in response to user or system events.
Outlets
Outlets provide a way to reference objects from your interface—the objects you
added to your story board—from source code files. You create an outlet by Control-
dragging from a particular object in your storyboard to a view controller file. This
creates a property for the object in your view controller file, which lets you access and
manipulate that object from code at runtime.