Reputation: 3
I use swift 4 setValuesForKeys()
assignment,it will not work,The “content” of this variable,But it will enter
override func setValue(_ value: Any?, forUndefinedKey key: String) {}
I use it on the swift 3.2, it can work, What reason is this excuse me
Upvotes: 0
Views: 204
Reputation: 1352
There's an update about @objc
and dynamic
in Swift 4, if you want to use KVC, add keyword mark it as an OBJC property:
@objc var content = ""
Upvotes: 2
Reputation: 2461
I think what you're looking for is this
override func setValuesForKeys(_ keyedValues: [String : Any]) {
}
Upvotes: 0