How to manipulate various controls, get values and assign operations is the most basic skill in iOS development, now we have the input box (Text Field), the segmented control (segmented control), the date control (Day picker), the slider (slider), the switch control (Switch), which controls such as text input. With a small example to do this function, the user enters personal information, then the program then the input information obtained and displayed.
(1) The interface is designed as follows:
。
(2) Bind the controls in the interface to the code, the outlet property is as follows:
。
(3) Set the action action on the slider and the OK button:
.
(4) implementation in Heightchanged ():
。
(5) The oktapped () method implements the button click:
。
(6) For keyboard display hidden issues, please refer to my previous blog "iOS development custom keyboard return key" and "iOS development soft keyboard use tips."
(7) The final running program: The effect is as follows:
。
。
Summing up, this blog is also read the Lin Yongjian Teacher's course after writing, thank you very much.
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
iOS development how to get input values for various controls