Safety Check #4
An initializer cannot call any instance methods, read the values of any instance properties, or refer to self as a value until after the first phase of initialization is complete.
class Fruit {
var name: String
init(fruitName: String) {
// in phase one
self.name = fruitName; // using self during the property assignment
// phase one is complete
}
}
let orange = Fruit(fruitName: "Orange");
So, how does this get special dispensation to use self, and to know what self refers to?