First, page bar
Create a new project, subclass the value of Uiviewcontroller, then delete the root view in storyboard, and drag a tab Bar Controller at the bottom right
To add a page, simply drag a normal view controller from the bottom right, drag it from the page bar controller to the new view controller, and select View controllers under the relationship Segue heading in the popup panel. Use these pages to create cocoa Touch Class for them and associate them.
Set the title and icon at the bottom of the page bar,
Second, selector
The picker is divided into date picker and picker View, the former is the day picker, the latter is the general picker, can be arbitrarily customized use.
(a) To implement a function: Click the button, pop up a warning view displays the date and time currently selected in the date picker
1) Drag a date picker and a button to the date page and set the constraint
2) Create the output interface of the date picker, select Date picker, press and hold right-drag to the implementation file, create an output interface named DatePicker,
3) When this view is loaded, the picker resets to the current implementation code for the date and time, written in the Viewdidload method,
4) How to implement the function, select the button, press and hold right-click below the implementation file, create an action method named Buttonpressed, and write the code,
5) achieve effect, show Greenwich Mean Time
(ii) The implementation of the custom Picker view, the following note a few points, the same steps as above do not say
1) Implement the controller as a data source and delegate, associate Datesource and delegate,
2) Add the protocol in the. h file
3) Create an array that provides the data to the picker and assigns it to the Characternames property, with the following code:
4) The method of the button and the data source, the method implementation of the delegate, combined with
5) Achieve effect
Not to be continued ...
Proficient in iOS development-use of page bar and picker