markohlebar / bind Goto Github PK
View Code? Open in Web Editor NEWData Binding and MVVM for iOS
License: MIT License
Data Binding and MVVM for iOS
License: MIT License
I found it's empty and there's something difficult for me
BINDINGS don't work well with subclasses. Need to inspect how to add the bindings from a superclass in the subclass.
Could you please point out how a two way binding can be done with a ViewModel and UITextField. From the example given it is quite easy to figure out the left to right assignments, but how can the right to left assignment be done.
I tried something like this, but this didn't make any change in the view model.
BINDViewModel(point,<>, pointField.text)
Thanks.
-> is reserved syntax, and triggers code completion when writing bindings like
BIND(self, leftKeypath, ->
which is quite annoying.
BNDView
/ BNDViewController
subclasses for MVVM
BNDTableViewController
and BNDCollectionViewController
to support rapid developmentBNDBinding
and MVVM
related implementation into separate projectsBINDT(self.viewModel, booleanProperty , ~>, self, other.booleanProperty, NSNegateBooleanTransformerName)
causes:
-[__NSCFConstantString transformedValue:]: unrecognized selector sent to instance 0x7fd34b395700
Sometimes you want to cancel the transform i.e. when getting images from a web service.
Great job on this library. I've only used it for a week but I could see it being a library I can reuse over and over on different projects.
I've got a question regarding model to view model bindings where the model is a Core Data managed object. The issue I'm seeing happens when the managed objects gets faulted, causing the binding to output a null value. I don't want the view model to change a property to null when its model object gets faulted.
This isn't a defect in the library but I'm wondering if you have an answer for how to correctly handle object faulting with view to view model binding.
It seems that the usage really boils down to BINDViewModel
and BIND
.
In terms of simplifying the interface we should trim unnecessary features like
shorthands BINDSL
, BINDSR
, BINDOS
and BINDS
which clutter the DSL and
autocompletion.
Is there a way to get the bindings to work on a UITextField while the user types?
With a simple example I've been unable to get the binding to fire when typing into the UITextField. It works find if I actually set the .text value manually.
UILabel *title = [UILabel new];
title.text = @"empty title";
UITextField field = [[UITextField alloc] init];
field.text = @"empty field";
//..
BIND(item, value, <>, field, text);
[BINDO(field, text) observe:^(id observable, id value) {
NSLog(@"value=%@", value); // any way to have this called as I type?
}];
//..
field.text = @"this works though";
Previously to experimenting with BIND I'd use addTarget:forControlEvents:UIControlEventEditingChanged to trigger a selector as the user types.
A more 'BINDy' way to do this would be great. Any ideas?
Shorthand check should check for "viewModel. " instead of "viewModel"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.