Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save reddioment/41dc4cd0fb4d98c5094c82802e7924a9 to your computer and use it in GitHub Desktop.
Save reddioment/41dc4cd0fb4d98c5094c82802e7924a9 to your computer and use it in GitHub Desktop.
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