How do I resolve this error? - The "ViewController" class has no initializers

I created UILabel

programmatically in swift, but it gives me the following error:

Class 'ViewController' has no initializers

enter image description here

Code:

class ViewController: UIViewController {

    let lbl_LastName: UILabel!

    override func viewDidLoad() {
        super.viewDidLoad()
        lbl_LastName.frame = CGRectMake(10, 230, 300, 21)
        self.view.addSubview(lbl_LastName)   
    }
}

      

+3


source to share


1 answer


change let lbl_LastName: UILabel!

tovar lbl_LastName: UILabel!



+9


source







All Articles