How to override setter in Swift
问题 A Superclass : class MySuperView : UIView{ var aProperty ; } A subclass inheritance the super class : class Subclass : MySuperClass{ // I want to override the aProperty's setter/getter method } I want to override the superclass's property's setter/getter method , how to override this method in Swift ? Please help me , thanks . 回答1: What do you want to do with your custom setter? If you want the class to do something before/after the value is set, you can use willSet / didSet : class