Не стреляйте себе в ногу как я D
protocol Fooo {
func a(a: Int, b: Int)
func b(a: Int, b: Int)
}
extension Fooo {
func a(a: Int, b: Int = 10) {
print("a from PROTOCOL")
}
func b(a: Int, b: Int) {
print("b from PROTOCOL")
}
}
class Foo: Fooo {
func a(a: Int, b: Int = 120) {
print("a from implementation")
}
func b(a: Int, b: Int) {
print("b from implementation")
}
}
let f: Fooo = Foo()
f.a(a: 10) //a from PROTOCOL
f.b(a: 12, b: 12) //b from implementation