Gold Challenge
This challenge is unique in that it does not have a specific problem or solution. Instead, it is an encouragement to spend some time reading interfaces written by the Swift team at Apple. Remember that you can Command-click on a type, function, method, or even operator to jump to a view in Xcode that shows you how the element is declared.
You first encountered the map(_:) method in Chapter 13, where you called it on arrays. map(_:) is not just a method on arrays, though. map(_:) is defined in a protocol extension on all Sequences by the Swift standard library.
The Swift standard library contains a large number of properties and methods provided by protocol extensions.
Many of them also include where clauses that restrict ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access