O'Reilly logo

Swift 3 ObjectOriented Programming - Second Edition by Gastón C. Hillar

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

Test your knowledge

  1. The { (game: Game) -> Bool in game.highestScore == highestScore && game.playedCount == playedCount } closure is equivalent to:
    1. { $0.highestScore == highestScore && $1.playedCount == playedCount }.
    2. { $0.highestScore == highestScore && $0.playedCount == playedCount }.
    3. { 0 -> 0.highestScore == highestScore && 0.playedCount == playedCount }.

  2. The closure { return condition($0) } is equivalent to:
    1. { (number: Int) -> Bool in return condition(number) }.
    2. { (number -> Bool) -> Int in condition <- (number) }.
    3. { 0 -> condition(number) }.

  3. A function type specifies:
    1. The parameter and return types for the function.
    2. Only the parameter names required for the function.
    3. The required function name and the return value without any details about the parameters. ...

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