How can I save and load the UIButton’s alpha values in my iPhone app? I want to do this the easiest way possible. I have tried using various methods, but none have worked for me so far.
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.
Try this:
CGFloat alpha = myButton.layer.opacity;You might need to
#import <QuartzCore/QuartzCore.h>.Edit (From this SO Question):
Then, you can simply store it in
NSUserDefaults:Then retrieve it like such:
And when you’re done with it:
NSUserDefaults Class Reference