Avalon
Avalon copied to clipboard
A prototype binding framework for iOS - to support the MVVM pattern
UISegmentedControl has a bug, if you remove an item the selected item index is decremented. This causes quite a few issues with Avalon, where the selection index is maintained.
Because Avalon makes use of a number of Objective-C APIs (e.g. KVO, associated properties) it imposes a number of uncomfortable constraints. It would be great to be able to remove...
If you bind the selected index first, then the items, the initial selection state is incorrect: ``` segmentedControl.bindings = [Binding(source: "selectedOption", destination: "selectedSegmentIndex", mode: .TwoWay), Binding(source: "options", destination: "segments")] ```...
https://github.com/ColinEberhardt/Avalon/blob/2be121f147210e52c2276fc65bb4beedd07daa10/Examples/SwiftWeather/Swift%20Weather/ViewController.swift#L13
Currently all bindings must be added before the bindingContext is set in order to create the binding.
https://github.com/ColinEberhardt/Avalon/blob/9fae570f6d7ef2b091e16effc9fca977f4952bf7/Avalon/Action.swift#L39