Skip to content

Files

Latest commit

 

History

History
37 lines (24 loc) · 574 Bytes

protocol_property_accessors_order.md

File metadata and controls

37 lines (24 loc) · 574 Bytes

Pattern: Wrong property accessors order

Issue: -

Description

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

Examples of correct code:

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


protocol Foo {
 var bar: String { get }
 }


protocol Foo {
 var bar: String { set }
 }

Examples of incorrect code:

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

Further Reading