Hi,
currently doing this but getting fatal error -
How can i add label programatically, currently doing this but gets a fatal error, kindly guide import
UIKit
class
QuizViewController: UIViewController
{
override
func
viewDidLoad() {
super
.viewDidLoad()
}
override
func
loadView() {
let
questionLabel = UILabel()
questionLabel.text = "Question"
questionLabel.frame = CGRect(x: 0, y: 0, width: 50, height: 100)
view.addSubview(questionLabel)
}
}
Kindly guide where i am making mistake, thanks