Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- typedef NS_ENUM(NSInteger, TypesDisplay) {
- TYPE_DISPLAY_COLLECTION,
- TYPE_DISPLAY_LIST
- // Embed segue for CatalogCollectionViewController
- if ([[segue identifier] isEqualToString:[MPStoryboard segueEmbedCatalog]])
- {
- self.catalogCollectionController = segue.destinationViewController;
- self.catalogCollectionController.typesDisplayCollection = TYPE_DISPLAY_COLLECTION;
- self.catalogCollectionController.selectItemHandler = ^(NSIndexPath *indexPath) {
- [blockSafeSelf selectItemAtIndexPath:indexPath];
- };
- }
- // Embed segue for CatalogTableViewController
- else if ([[segue identifier] isEqualToString:[MPStoryboard segueEmbedCatalogTable]])
- {
- self.catalogTableViewController = segue.destinationViewController;
- self.catalogTableViewController.typesDisplayList = TYPE_DISPLAY_LIST;
- self.catalogTableViewController.selectItemHandler = ^(NSIndexPath *indexPath) {
- [blockSafeSelf selectItemAtIndexPath:indexPath];
- };
- }
- - (void)flipDisplayType
- if ([self.catalogContainerView isHidden]){
- [self.catalogContainerView setHidden:NO];
- [self.catalogTableContainerView setHidden:YES];
- self.catalogCollectionController.typesDisplayCollection = TYPE_DISPLAY_COLLECTION;
- MPNormalBarButtonItem *displayButton = [[MPNormalBarButtonItem alloc] initWithTitle:@"Liste" style:UIBarButtonItemStylePlain target:self action:@selector(flipDisplayType)];
- [self.navigationItem setRightBarButtonItem:displayButton];
- }else{
- [self.catalogContainerView setHidden:YES];
- [self.catalogTableContainerView setHidden:NO];
- self.catalogTableViewController.typesDisplayList = TYPE_DISPLAY_LIST;
- MPNormalBarButtonItem *displayButton = [[MPNormalBarButtonItem alloc] initWithTitle:@"Collection" style:UIBarButtonItemStylePlain target:self action:@selector(flipDisplayType)];
- [self.navigationItem setRightBarButtonItem:displayButton];
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement