rspec/rules/S4184/swift/rule.adoc
2021-04-28 18:08:03 +02:00

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!
----