iOS development how to get input values for various controls

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.