All variables of type IBOutlet should be set as private. IBOutlet variables are typically used in Swift to connect the UI elements from the storyboard to the code. Making these variables private enhances encapsulation and data hiding, which are fundamental principles of object-oriented programming.
Non-Compliant Code Examples
classMyClass{@IBOutletvarlabel:UILabel!}
Compliant Code Examples
classMyClass{@IBOutletprivatevarlabel:UILabel!}
シームレスな統合。 Datadog Code Security をお試しください
Datadog Code Security
このルールを試し、Datadog Code Security でコードを解析する
このルールの使用方法
1
2
rulesets:- swift-code-style # Rules to enforce Swift code style.