I am making a utility application, and I have a label on my main view. Depending on the user’s selection, that label should say one of two things. How can I use a segmented control to change the label text?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In your flipside, create an IBAction called
segmentedControlChanged– and hook it up to the ‘value changed’ trigger on the segmented control.At the top of your settings controller, declare this constant:
In your
segmentedControlChangedmethod, write to NSUserDefaults, like so:In your main view controller’s
viewWillAppear, put the following code: