I have an UIButton to which an UILabel was added as a subview.
Is there an easy way to get the UILabel back out of it so I can change it’s title ?
I have an UIButton to which an UILabel was added as a subview. Is
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.
If you assign a
tagto it while you still have a reference to it, you can later find it by searching for views with thattag.Like this:
Later…
If there’s no way for you to set the
tag, you can also loop over the button’s subviews, looking for an instance ofUILabel: