The Tag property is a number and when used with the corresponding viewWithTag function one can access a specific subview without the need for an outlet.
(Swift 3.0)
Example
override func viewDidLoad() { super.viewDidLoad() let label = view.viewWithTag(1) as! UILabel label.text = "New text here" }
Observations
- You can give the same Tag to multiple views
- The first view in the document outline matching the Tag number is selected when viewWithTag is used
(Swift 3.0)
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.