TSTabViewModel Class Reference
Inherits from | TSNavigationStripModel : NSObject |
Conforms to | TSTabViewDataSource |
Declared in | TSTabViewModel.h |
Overview
TSNavigationStripComponent is base class, which provides appearance information for TSNavigationStripView's section or item.
@warning In sake of code reuse, TSTabViewModel inherits from TSNavigationStripModel. Because they have similar underlying data structure and logic, it safes many lines of code) Hovewer, few methods that provided by TSNavigationStripModel interface are not applied in context of TSTabViewModel. - (id)initWithNavigationStrip: - (void)insertNewSection:atIndex:animated: - (void)removeSectionAtIndex:animated: - (void)setSections: These methods are overrided as dummy and do nothing beside assertion. TSTabViewModel replace these methods with following: - (id)initWithTabView: - (void)insertNewTab:atIndex:animated: - (void)removeTabAtIndex:animated: - (void)setTabs:
Properties
tabView
Readonly reference to TSTabView instance managed by this model.
@property (nonatomic, strong, readonly) TSTabView *tabView
Declared In
TSTabViewModel.h
Instance Methods
initWithTabView:
Initialize instance of TSTabViewModel with corresponding TSTabView object.
- (id)initWithTabView:(TSTabView *)tabView
Parameters
- tabView
Instance of TSTabView which would be managed by this data model.
Declared In
TSTabViewModel.h
insertNewTab:atIndex:animated:
Insert new tab/page into TSTabViewModel. TSTabView would be notified about changes in data model.
- (void)insertNewTab:(TSTabViewSection *)tabInfo atIndex:(NSInteger)index animated:(BOOL)animated
Parameters
- tabInfo
Provide appearance and content infomation about new tab.
- index
Insert position.
- animated
If YES insertion would be done aniamted.
Declared In
TSTabViewModel.h
removeTabAtIndex:animated:
Insert new tab/page into TSTabViewModel. TSTabView would be notified about changes in data model.
- (void)removeTabAtIndex:(NSInteger)index animated:(BOOL)animated
Parameters
- index
Remove position.
- animated
If YES removing would be done aniamted.
Declared In
TSTabViewModel.h
setTabs:
Provide content description for TSTabViewModel.
- (void)setTabs:(NSArray *)tabs
Parameters
- tabs
Array of TSTabViewSection or NSDictionary objects. TSTabViewSection instance would be constructed if needed.
Declared In
TSTabViewModel.h