Protocol Property Accessors Order

When declaring properties in protocols, the order of accessors should be get set

  • Identifier: protocol_property_accessors_order
  • Enabled by default: Yes
  • Supports autocorrection: Yes
  • Kind: style
  • Analyzer rule: No
  • Minimum Swift compiler version: 5.0.0
  • Default configuration:
    KeyValue
    severity warning

Non Triggering Examples

protocol Foo {
 var bar: String { get set }
 }
protocol Foo {
 var bar: String { get }
 }
protocol Foo {
 var bar: String { set }
 }

Triggering Examples

protocol Foo {
 var bar: String { set get }
 }