I have the following class, with an init method:
class user {
var name:String
var address:String
init(nm: String, ad: String) {
name = nm
address
In swift 2.0 and Later it works like this (all cases)
init(newString:String) {
super.init(string:newString)
// Designed initialiser
}
override init(someString: String) {
super.init(mainString: someString)
// Override initialiser when subclass some class
}
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
// Some boilerplate code to handle error (needed when override)
}
convenience init(newString:String, withParameters:Dictionary) {
self.init(someString:newString)
//Convenience initialiser
}