Swift Create Label Programmatically

[Solved] Swift Create Label Programmatically | Swift - Code Explorer | yomemimo.com
Question : swift create label programmatically

Answered by : famous-fish-iemmn7l6tzor

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 : https://stackoverflow.com/questions/24081731/how-to-create-uilabel-programmatically-using-swift | Last Update : Thu, 28 May 20

Answers related to swift create label programmatically

Code Explorer Popular Question For Swift