Instantly share code, notes, and snippets.

Embed
What would you like to do?
init-class-subclass-override
class SomeClass {
var str: String
init(str: String) {
self.str = str
}
convenience init(strFromInt num: Int) {
self.init(str: "\(num)")
}
}
class AnotherClass: SomeClass {
var text: String
init(text: String, str: String) {
self.text = text
super.init(str: str)
}
convenience override init(str: String) {
self.init(text: "", str: str)
}
convenience init(strFromInt num: Int) {
self.init(str: "\(num)")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment