Slide 4
Slide 4 text
খωλ
protocol SomeProtocol {
func printSelf()
}
extension SomeProtocol {
func printSelf() {
print("SomeProtocol")
}
}
class SomeClass: SomeProtocol {
func printSelf() {
print("SomeClass")
}
}
let sc = SomeClass()
sc.printSelf()
// SomeClass
(sc as SomeProtocol).printSelf()
// SomeClass
protocol SomeProtocol {
}
extension SomeProtocol {
func printSelf() {
print("SomeProtocol")
}
}
class SomeClass: SomeProtocol {
func printSelf() {
print("SomeClass")
}
}
let sc = SomeClass()
sc.printSelf()
// SomeClass
(sc as SomeProtocol).printSelf()
// SomeProtocol
≠