Pattern: @IBOutlet
declared as weak
Issue: -
@IBOutlet
s shouldn't be declared as weak
.
Examples of correct code:
class ViewController: UIViewController {
@IBOutlet var label: UILabel?
}
class ViewController: UIViewController {
weak var label: UILabel?
}
Examples of incorrect code:
class ViewController: UIViewController {
@IBOutlet weak ↓var label: UILabel?
}
class ViewController: UIViewController {
@IBOutlet unowned ↓var label: UILabel!
}
class ViewController: UIViewController {
@IBOutlet weak ↓var textField: UITextField?
}