-
Notifications
You must be signed in to change notification settings - Fork 1
Home
- How to enable binding support in your view controllers
- Catalog of views with binding support
- Binding expression syntax and expression types
Binding contexts are used to evaluate a key path to a concrete binding source value.
The Beacon binding behavior determines the root binding context used for top level view bindings. If you add the binding behavior like this:
- (void)viewDidLoad {
[super viewDidLoad];
[AKABindingBehavior addToViewController:self];
}
then the view controller serves as root data context (or in MVVM terms as view model) and if it implements the protocol AKABindingBehaviorDelegate also as binding delegate.
You can also specify a separate view model like this:
- (void)viewDidLoad {
[super viewDidLoad];
[AKABindingBehavior addToViewController:self
withDataContext:self.viewModel
delegate:self.bindingDelegate];
}
The binding delegate allows you to monitor control many aspect of the binding process and AKAControl instances involved in bindings. Please take a look at the corresponding delegate methods to learn about the details.
Some view types, such as UITableView provide a nested data context for bindings declared in cells. If a table view section is bound to an array, then cells in that section will use the corresponding array item as data context. Bindings can however still access the root data context using the "$root" prefix.