March 2017
Intermediate to advanced
226 pages
5h 13m
English
Placing attributes like @objc, @testable, @available, and @discardableResult on their own lines before a member declaration has become a widely adopted Swift style:
| | @objc(objectAtIndex:) // yes |
| | internal func objectAt(_ index: Int) -> AnyObject { |
| | |
| | @available(*, unavailable, renamed: "Iterator") // yes |
| | public typealias Generator = Iterator |
| | |
| | @discardableResult // yes |
| | func _copyContents(initializing ptr: |
| | UnsafeMutablePointer<Iterator.Element>) |
| | -> UnsafeMutablePointer<Iterator.Element> |
This approach limits horizontal declaration length. It allows a member to float below its attribute and supports flush-left access modifiers, so internal, public, and the like appear in the ...
Read now
Unlock full access