Last active
June 7, 2019 10:01
-
-
Save onmyway133/0fcf8af3817c7d945515dbbc35b5b9b1 to your computer and use it in GitHub Desktop.
Init in protocol extension.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protocol P { | |
init() | |
} | |
extension P { | |
init(something: AnyObject) { | |
self.init() | |
print("P") | |
} | |
} | |
struct A: P { | |
init() { | |
print("A") | |
} | |
} |
Author
onmyway133
commented
Jul 6, 2016
protocol P: class {
init(core: AnyObject)
}
extension P {
init(something: AnyObject) {
self.init(core: something)
print("P")
}
}
class A: P {
required init(core: AnyObject) {
print("A")
}
}
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment