Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumSwiftprotocol-oriented programmingSingle-choice MCQ

In protocol-oriented programming, what is the practical difference between declaring a method in the protocol's body versus only providing it in a protocol extension (with no requirement in the body)?

protocol Greeter { func hello() -> String // a requirement } extension Greeter { func hello() -> String { "protocol" } func bye() -> String { "protocol" } // NOT a requirement }