Name: mvvm-example-objc
Owner: Futurice
Description: Example MVVM structure for iOS apps, written in Objective-C
Created: 2016-04-28 16:42:21.0
Updated: 2018-04-18 12:45:31.0
Pushed: 2016-05-06 14:29:51.0
Homepage: null
Size: 663
Language: Objective-C
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
PersonViewController
) with its own view model that's initialized with a personPersonListViewModel
creates the correct PersonViewModel
NSDate
birthdate that must be formattedTo fetch data from a JSON backend, you can do something like this in the store:
L *url = [NSURL URLWithString:@"https://api.myjson.com/bins/nghk"];
rn [[[NSURLSession sharedSession] rac_GET:url]
map:^(RACTuple *result) {
NSData *data = result.first;
NSArray *peopleArray = [NSJSONSerialization JSONObjectWithData:data options:0 error:NULL];
NSMutableArray *people = [NSMutableArray array];
for (NSDictionary *personDict in peopleArray) {
Person *person = [[Person alloc] initWithFirstName:personDict[@"firstName"] lastName:personDict[@"lastName"]];
[people addObject:person];
}
return [people copy];
}];