Intermediate Swift
Q46 / 100

What is a protocol extension in Swift?

Correct! Well done.

Incorrect.

The correct answer is B) Adding default implementations to protocol methods, which any conforming type gets for free

B

Correct Answer

Adding default implementations to protocol methods, which any conforming type gets for free

Explanation

extension Collection where Element: Equatable { func unique() -> [Element] { ... } } provides default methods to all conforming Collection types.

Progress
46/100