September 2013
Intermediate to advanced
112 pages
2h 42m
English
Making our model code flexible is the low-hanging fruit, and keeping a view up-to-date with a model is usually a hard problem. A model object has to be aware of all the views accessing its data, which just leads to all sorts of problems and code spaghetti. Imagine a world where it all just works: you change the name on a User, and the appropriate label instantly reflects those changes...no code spaghetti or zero-ing references.
I’m talking this up so much because it is possible to implement. iOS has a concept of key-value observing (KVO). Built into the frameworks is a system by which one object can passively observe changes in properties of another object. Those properties are referred to by keys
Read now
Unlock full access