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. When we declare protocols, the Self keyword signifies:
    1. The type that implements the protocol.
    2. The instance of a class that conforms to the protocol.
    3. The instance of a struct that conforms to the protocol.

  2. Generics allow us to declare a class that:
    1. Can use a generic type only as the type for stored and type properties.
    2. Can use a generic type only as an argument for its initializers.
    3. Can work with many generic types.

  3. The open class ImmutableVector3D<T: FloatingPoint> line means:
    1. The generic type constraint specifies that T must conform to the ImmutableVector3D protocol or belong to the ImmutableVector3D class hierarchy.
    2. The generic type constraint specifies that T must conform to the FloatingPoint protocol or belong to the FloatingPoint ...

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