Skip to content

Commit 7d74fd5

Browse files
committed
MARK comments for protocol extensions
1 parent 0e5e16d commit 7d74fd5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

README.markdown

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,16 +232,20 @@ class BoardLocation {
232232

233233
When adding protocol conformance to a class, prefer adding a separate class extension for the protocol methods. This keeps the related methods grouped together with the protocol and can simplify instructions to add a protocol to a class with its associated methods.
234234

235+
Also, don't forget the `// MARK` comment to keep things well-organized!
236+
235237
**Preferred:**
236238
```swift
237239
class MyViewcontroller: UIViewController {
238240
// class stuff here
239241
}
240242

243+
// MARK: - UITableViewDataSource
241244
extension MyViewcontroller: UITableViewDataSource {
242245
// table view data source methods
243246
}
244247

248+
// MARK: - UITableViewDelegate
245249
extension MyViewcontroller: UIScrollViewDelegate {
246250
// scroll view delegate methods
247251
}

0 commit comments

Comments
 (0)