I want to extend my usage of Swift Property Observers beyond scalar values like Double
, String
, Int
, etc... to [Double]
, [String]
, [Int]
. While it useful (using didSet & willSet) to know when the whole Array struct has been modified it is often beneficial to know which index in the array changed - for example so that unnecessary secondary computations can be avoided.
How is this achieved?