Skip to content
RED SAG Skills
hardStudy question · answer published in iOS interview questions, so no pointsswiftprotocols

Extension method that is not a requirement

What does this print?

protocol Greeter {}
extension Greeter {
    func hello() -> String { "base" }
}
struct Hindi: Greeter {
    func hello() -> String { "namaste" }
}

let g: any Greeter = Hindi()
print(g.hello())
Choose one answer

Discussion 0

Join free to post in the discussion.

Related questions