Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SWIFT

swift create label programmatically

let label = UILabel(frame: CGRect(x: 0, y: 0, width: 200, height: 21))
label.center = CGPoint(x: 160, y: 285)
label.textAlignment = .center
label.text = "I'm a test label"
self.view.addSubview(label)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #swift #create #label #programmatically
ADD COMMENT
Topic
Name
7+3 =