ios - UIView viewwithtag method in swift -


i'm trying learn swift. programmatically add labels. want change properties later.

the viewwithtag method returns uiview, how access uilabel this?

cheers

you need use typecast. code it:

    if let thelabel = self.view.viewwithtag(123) as? uilabel {         thelabel.text = "some text"     } 

Comments

Popular posts from this blog

C# random value from dictionary and tuple -

cgi - How do I interpret URLs without extension as files rather than missing directories in nginx? -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -