UIView is a container that can add other controls
View A is added to view B, A is a child view of B, and B is the parent view of a
Each viewcontroller will have a view property by default.
The controller is used to manage the view's life cycle: when to create and when to destroy
The controller is used to handle user interaction events (logic code to be written in the controller)
First Responder: Uitextfield, become the first responder automatically eject the keyboard
Fallback keyboard
Revoke First Responder identity
[Self.firstfield Resignfirstresponder];
Call the endediting of view:
[Self.view Endediting:yes];
List of issues
1. What is Ibaction Iboutlet
Iboutlet used to connect properties
Ibaction is used to connect methods with void
2. Why put attributes in a class extension
For security and encapsulation
3. Why use the weak property to decorate
Apple's official recommendation
If you use strong, you can run it properly.
Link Introduction
button when using the connection click Method, if you want to pass the parameter can only be button himself
Type
ID Default
UIButton * Making selections
Reason: ' [<viewcontroller 0x7f8aa071dc50> Setvalue:forundefinedkey:]: This class was not key value Coding-compliant For the key Tempbutton. '
After the connection, the attribute is deleted, but the connection is not canceled in SB
Reason: '-[viewcontroller clickButton2:]: Unrecognized selector sent to instance 0x7fbb8b925220 '
After associating a method with a button, the method is removed, and no connection is canceled in SB
A view can have multiple child view
A child view can have only one parent view
Common Properties of UIView
Subviews viewing the view's child view
Superview viewing the view's parent view
Removefromsuperview: Delete Child view from parent view
Addsubview: Adding a child view to a view
Ios-ui Foundation-uiview and Uiviewcontroller