MMRestaurantViewModel Class Reference
| Inherits from | RVMViewModel : NSObject | 
| Declared in | MMRestaurantViewModel.h MMRestaurantViewModel.m  | 
Overview
The View Model for
MMRestaurantViewController. Responsiblefor providing the data for the view controller.
*
See
anlax.com/blog/model-view-viewmodel-for-ios/for moreinformation on the ModelView-View-Model (MVVM) architecture
pattern.
Tasks
- 
	
		
merchantInformationproperty - 
	
		
controllerShouldShowProgressIndicatorproperty - 
	
		
controllerShouldReloadDataSourceproperty - 
	
		
selectedTabIndexproperty - 
	
		
reviewOrderproperty - 
	
		
dataSourceTypeproperty - 
	
		
reviewTabIndexproperty - 
	
		
– getTabCategories - 
	
		
– getAllMenuItems - 
	
		
– numberOfItemsInCurrentDataSource - 
	
		
– getItemFromCurrentDataSourceForIndexPath: - 
	
		
– searchForItemWithValue: 
Properties
controllerShouldReloadDataSource
- Notifies the corresponding conroller that the data source
 
@property (nonatomic, strong) RACSubject *controllerShouldReloadDataSourceDiscussion
- has been updated.
 
Declared In
MMRestaurantViewModel.hcontrollerShouldShowProgressIndicator
- Notifies the corresponding controller to hide/show a progress
 
@property (nonatomic, strong) RACSubject *controllerShouldShowProgressIndicatorDiscussion
indicator based on whether or not data is currently being
retrieved from the network.
Declared In
MMRestaurantViewModel.hdataSourceType
- Represents the type of objects that are
 
@property (nonatomic) NSInteger dataSourceTypeDiscussion
- currently in the data source.
 
*
- @see 
MMMenuItemDataSourceandMMReviewsDataSource 
Declared In
MMRestaurantViewModel.hmerchantInformation
- The 
MMMerchantmodel that this view model represents. 
@property (nonatomic, strong) MMMerchant *merchantInformationDeclared In
MMRestaurantViewModel.hreviewOrder
- Represents which orderering the reviews
 
@property (nonatomic) NSInteger reviewOrderDiscussion
- should be organized by.
 
*
- @see 
MMOrderByRecentandMMOrderByTopRated 
Declared In
MMRestaurantViewModel.hInstance Methods
getAllMenuItems
- Retrieves an 
NSMutableArrayof all 
- (RACSignal *)getAllMenuItemsDiscussion
the menu items for the currently
represented restaurant.
*
@return A
NSMutableArrayof all themenu items for the currentmerchant.
Declared In
MMRestaurantViewModel.hgetItemFromCurrentDataSourceForIndexPath:
- Returns the object that at the specified
 
- (id)getItemFromCurrentDataSourceForIndexPath:(NSIndexPath *)indexPathDiscussion
- index in the current data source.
 
*
- @param indexPath Position of object in data source.
 
*
@return The object at the specified position in data
source.
Declared In
MMRestaurantViewModel.hgetTabCategories
- Retrieves an 
NSArrayof strings that will 
- (RACSignal *)getTabCategoriesDiscussion
represent the tab names in the category
segmented control.
*
@return A signal containing an
NSArrayofcategory names.
Declared In
MMRestaurantViewModel.hnumberOfItemsInCurrentDataSource
- Returns the number of items in the
 
- (NSInteger)numberOfItemsInCurrentDataSourceDiscussion
- data source.
 
*
@return The number of items in the
current data source.
Declared In
MMRestaurantViewModel.hsearchForItemWithValue:
- Searchs for a value in the current data sources and
 
- (void)searchForItemWithValue:(NSString *)valueToSearchForDiscussion
updates public data source to reflect the values
found. Currently, this method only works when the
data source has
MMMenuItemobject in it. Thesearch is performed against the
namepropertyof the
MenuItem.
*
@param valueToSearchFor The value of the
nameto searchfor.
Declared In
MMRestaurantViewModel.h