Skip to content

Files

Latest commit

 

History

History
52 lines (27 loc) · 672 Bytes

attributes.md

File metadata and controls

52 lines (27 loc) · 672 Bytes

Pattern: Malformed attribute

Issue: -

Description

Attributes should be on their own lines in functions and types, but on the same line as variables and imports.

Examples of correct code:

@objc var x: String


@objc private var x: String


@nonobjc var x: String


@IBOutlet private var label: UILabel


@IBOutlet @objc private var label: UILabel

Examples of incorrect code:

@objc
 var x: String


@objcvar x: String


@objc
 privatevar x: String


@nonobjcvar x: String


@IBOutlet
 privatevar label: UILabel

Further Reading