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

Popular posts from this blog

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -