Pattern: Non-private @IBOutlet
Issue: -
@IBOutlet
should be private to avoid leaking UIKit
to higher layers.
Examples of correct code:
class Foo {
@IBOutlet private var label: UILabel?
}
class Foo {
@IBOutlet private var label: UILabel!
}
class Foo {
var notAnOutlet: UILabel
}
class Foo {
@IBOutlet weak private var label: UILabel?
}
class Foo {
@IBOutlet private weak var label: UILabel?
}
Examples of incorrect code:
class Foo {
@IBOutlet ↓var label: UILabel?
}
class Foo {
@IBOutlet ↓var label: UILabel!
}