Protocol compliance using extensions in Swift
Forums:
class Shape {}
protocol Printable {
func Print()
}
extension Shape: Printable {
func Print() {
//implementation
}
}
let shape = Shape()
shape.Print()
- Log in to post comments