I’ve set colors for my controls in interface builder.
I need to dump these colors and assign them to variables.
I then want to use these variable for other controls.
Can someone point me at an example ?
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.
The way you programmatically access one of the color properties of your control, actually depends on the control itself, and the color you want. But here is an example using
UIButtonstoring itscurrentTitleColorproperty (UIColor).That said, unless you really need to reuse the color, you can shortcut it like so :
You can find the list of properties for each control class in their respective documentation pages. Hope that helps.