17 lines
476 B
Plaintext
17 lines
476 B
Plaintext
Marking a variable with ``++IBOutlet++`` allows it to be connected with a Storyboard component through the Interface Builder. Allowing such a variable to be accessed outside the class, may result in other classes making assignments that override the automatic dependency injection from the Storyboard itself.
|
|
|
|
|
|
== Noncompliant Code Example
|
|
|
|
----
|
|
@IBOutlet var label: UILabel! // Noncompliant
|
|
----
|
|
|
|
|
|
== Compliant Solution
|
|
|
|
----
|
|
@IBOutlet private var label: UILabel!
|
|
----
|
|
|