ios - Monitor the count of a mutable array in swift. -
hi want monitor count of mutable array in swift. whenever add/remove objects array, need notification regarding count. kvo helps here?, if not other possible solutions. appreciated.
you should able use kvo in swift using dynamic
keyword. however, particular problem—why not try using property observer:
var mutablearray: [anyobject]? { didset { println("count changed \(oldvalue.count) \(newvalue.count)") } }
Comments
Post a Comment