raywenderlich/swift-style-guide — pull request #70 by gregheo (2014-12-09 03:08:05+00:00)
Title: Protocol conformance in extensions

This is something Matt G. did in _Swift by Tutorials_ that I liked. When you want to implement a protocol, I propose doing this as a class extension rather than adding it to the `class` declaration.

Rationale: keeps the `class` line clear, groups the protocol + its methods together, and can simply "add this code to the file" instructions by adding protocol conformance + methods in one shot.

See pull request for suggested text. You cannot declare properties in extensions so this is not great if part of implementing the protocol involves some closely related properties. But I think it's still worthwhile.