Beginner
Swift
Q38 / 100
What is the any keyword in Swift 5.7 (existential type)?
Correct! Well done.
Incorrect.
The correct answer is B) Explicitly marks an existential type: var p: any Drawable — a box that holds any value conforming to Drawable
B
Correct Answer
Explicitly marks an existential type: var p: any Drawable — a box that holds any value conforming to Drawable
Explanation
Swift 5.7 requires any to signal existential types (var shape: any Shape), distinguishing them from concrete types and opaque types (some Shape).
Progress
38/100