Skip to content

Files

Latest commit

 

History

History
37 lines (24 loc) · 691 Bytes

prohibited_interface_builder.md

File metadata and controls

37 lines (24 loc) · 691 Bytes

Pattern: Use of Interface Builder

Issue: -

Description

Creating views using Interface Builder should be avoided.

Examples of correct code:

class ViewController: UIViewController {
    var label: UILabel!
}


class ViewController: UIViewController {
    @objc func buttonTapped(_ sender: UIButton) {}
}

Examples of incorrect code:

class ViewController: UIViewController {
    @IBOutlet var label: UILabel!
}


class ViewController: UIViewController {
    @IBActionfunc buttonTapped(_ sender: UIButton) {}
}

Further Reading