Using key-value programming (KVP) with Swift

后端 未结 4 2251
小鲜肉
小鲜肉 2021-02-09 09:02

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:35

    I'm not sure about KVP, but KVO isn't currently supported in Swift. See also this dev forums thread:

    https://devforums.apple.com/thread/227909

提交回复
热议问题