O'Reilly logo

Swift Programming: The Big Nerd Ranch Guide by John Gallagher, Matthew Mathias

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required