My first IOS app development and the first IOS app development
My firstIOSDevelop applications
1. Requirement Description
2. Development Environment Introduction
3. Create a project
4. project configuration
5. directory structure
6. interface settings
7. Associate Input and Output
8. associated Event code
9. Running result
10. UITextField Class
Before the game starts, we all need to enter our role name to implement the conversation. Ask the user to enter the role name and click "OK". "Dear xx, we are about to embark on a magical adventure !"
OS X EI Captian: 10.11.4
Xcode: 1, 7.3
For ios: 9.3
Model: iphone 6 s/iphone 6 s plus
Xcode English version:
1. "Create a new Xcode project" (Create a new project)
2. "Choose a template for your new project" (what kind of project is created), we Choose iOS> Application> Single View Application
3. "Choose options for your new project" (configure your project options ),
Bundle Identifier (equivalent to the package name concept), Language: Objective-C, Devices: iPhone, Use Core Data: No, include Unit Tests: YES, include UI Tests: YES
4. Save the project directory. The project has been created.
Project Settings
File> Project Settings. the iOS version is 9.3.
TARGETS Configuration
General: General Capabilities: system function authorization configuration Resource Tags: Resource tag Info: Information Build Settings: Compilation configuration Build Phases: compiled dependency configuration Build Rules: compilation Rules
Use the default configuration for this application
"Show the Project navigator" (view the Project directory)
AppDelegate: application event Delegate AppDelegate. h (header file) AppDelegate. mViewController: controller layer, mainly responsible for view interaction. Main. storyboard: The Main view file and XML standard file, which can be operated visually in Xcode. Assets. xcassets: The view displayed when LaunchScreen. storyboard is Launch. Info. plist: a collection of info data. The data types include string and array. Main. m: entry file.
"Main. storyboard"> "Show the Object Library" (interface component)
Text Field: Text input box Label: Text Button: Button
Drag the following interface:
Define input and output ports:
Add in ViewController. h
@property (weak, nonatomic) IBOutlet UITextField *name;@property (weak, nonatomic) IBOutlet UILabel *text;
Associated input and output ports:
In the following view, right-click the control and drag it to the corresponding code string for association.
Define events:
Add in ViewController. h
- (IBAction)submit:(id)sender;
Associated events:
As shown in, the operation method is similar to that of the associated input and output ports. You need to select Action and specific events.
Touch Down Touch Press
Compile the Event code, ViewController. m:
-(IBAction) submit :( id) sender {NSString * str = [NSString stringWithFormat: @ "Dear % @, we are about to embark on a magical adventure! ", Self. name. text]; [self. text setText: str];}
View the running result:
The article is over!
UITextField Class Reference
Https://developer.apple.com/library/tvos/documentation/UIKit/Reference/UITextField_Class/