Skip to main content
added 308 characters in body
Source Link

Your "next view controller" shouldn't have to know anything about the view controller presenting it ("first view controller"). You should consider just passing your view model to the "next view controller". Also, consider passing something more concrete than just an NSDictionary as your view model. This link does an okay job of explaining what a

View models are used to represent the thing you are displaying in the view model islayer. http://stackoverflow.com/questions/11064316/what-is-viewmodel-in-mvcThey typically look something like this.

@interface CatViewModel : NSObject
@property (nonatomic, strong) NSString *name;
@property (nonatomic, strong) NSString *breed;
@property (nonatomic, strong) NSDate *dateOfBirth;
@property (nonatomic, strong) NSArray* treats;
@property (nonatomic) BOOL canHasCheezBurger;
@end

Your "next view controller" shouldn't have to know anything about the view controller presenting it ("first view controller"). You should consider just passing your view model to the "next view controller". Also, consider passing something more concrete than just an NSDictionary as your view model. This link does an okay job of explaining what a view model is. http://stackoverflow.com/questions/11064316/what-is-viewmodel-in-mvc

Your "next view controller" shouldn't have to know anything about the view controller presenting it ("first view controller"). You should consider just passing your view model to the "next view controller". Also, consider passing something more concrete than just an NSDictionary as your view model.

View models are used to represent the thing you are displaying in the view layer. They typically look something like this.

@interface CatViewModel : NSObject
@property (nonatomic, strong) NSString *name;
@property (nonatomic, strong) NSString *breed;
@property (nonatomic, strong) NSDate *dateOfBirth;
@property (nonatomic, strong) NSArray* treats;
@property (nonatomic) BOOL canHasCheezBurger;
@end
Source Link

Your "next view controller" shouldn't have to know anything about the view controller presenting it ("first view controller"). You should consider just passing your view model to the "next view controller". Also, consider passing something more concrete than just an NSDictionary as your view model. This link does an okay job of explaining what a view model is. http://stackoverflow.com/questions/11064316/what-is-viewmodel-in-mvc