Using key-value programming (KVP) with Swift

后端 未结 4 1145
既然无缘
既然无缘 2021-02-09 09:01

In Objective-C with Cocoa a lot of tasks can be accomplished without explicit loops by using Key-Value Programming (KVP). For example, I can find the largest number in an array

4条回答
  •  醉酒成梦
    2021-02-09 09:47

    You can still use (at least) the didSet willSet provided by Swift on properties. I guess it's better than nothing.

提交回复
热议问题