Example: A contact’s ﬁrst name
Most are simple values - numbers, strings, objects
Can be functions which dynamically “compute” value
Watch for property changes
Takes some action
Examples: Update view, send data to server
Two objects, “bound” together
When one changes, the other changes also
The contact ﬁrstName property is bound to the
textFieldView value property.
When the contact’s ﬁrstName is updated,
textFieldView’s value is updated automatically.
When textFieldView’s value changes, the
valueDidChange observer kicks in & updates the UI.
Glue Code Eliminated!
Controllers and views automatically stay in sync
with the model objects in your application!
Accessed like stored properties ( with get() )
Calls a function to compute the value
Declared with .property()
Key Value Observing
Allows Object A to observe changes to Object B
How binding is able to work
Abbreviated as KVO
Automatic for stored (non-computed) properties
Requires a little setup for computed properties...
Computed Property KVO
When declaring, list the attributes the computed
property relies on:
Generate skeletons for your application, models, views,
Helps you get started quickly
Gives you a standard place to put things
Generate your views with small, declarative helpers
Similar to Ruby on Rails view helpers
In fact, written in Ruby!
Handles including JS ﬁles and view partials into your
HTML ﬁle - less work for you.
Allows change-and-refresh style development
Can proxy to external website backends for server
Packages all assets into single ﬁles - 1 HTML, 1 CSS, 1
Host your app on any server or CDN - just static ﬁles