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.
You first encountered the map(_:) method in Chapter 13, where you called it on arrays.
Then in Chapter 19, you called map(_:) on a range constructed with the ..< operator.
Both of these were actually calling map(_:) methods defined in protocol extensions 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 their use based on various criteria.
Remember that you can Command-click on a type, ...
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