Appearance proxies / UI_APPEARANCE_SELECTOR in Swift?
问题 The Apple documentation states: To participate in the appearance proxy API, tag your appearance property selectors in your header with UI_APPEARANCE_SELECTOR. In Objective-C one can annotate properties with UI_APPEARANCE_SELECTOR like this: @property (nonatomic, strong) UIColor *foregroundColor UI_APPEARANCE_SELECTOR; How can I do the same in Swift? 回答1: Mark your custom view property as dynamic . For example: class YourCustomView: UIView { @objc dynamic var subviewColor: UIColor? { get {