Reputation: 596
Hello I am using Page menu in application and i want to push from didSelectRowAtIndexPath in next view in one view which is involed in page menu
i know all way which we use for push and model.if i am using model with custom navigation bar then page menu hide on dismiss model.
Upvotes: 0
Views: 426
Reputation: 284
One can not push the viewcontroller in pageView , PageviewController don't have navigation controller .
Solution :
There are two ways to make this possible suggested by Nitin Gohel
You can send the information in Notification required in another viewController.
NSDictionary* userInfo = @{@"abc": @"aaa"};
NSNotificationCenter* nc = [NSNotificationCenter defaultCenter];
[nc postNotificationName:@"One" object:self userInfo:userInfo];
In MainViewController just set the onserver for that notification in viewDidLoad method
- (void)viewDidLoad {
[super viewDidLoad];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(OneNoti:) name:@"One" object:nil];
}
And perform push from MainViewController:
-(void) OneNoti:(NSNotification*)notification
{
NSDictionary* userInfo = notification.userInfo;
NSNumber* total = (NSNumber*)userInfo[@"total"];
NSLog (@"Successfully received test notification! %i", total.intValue);
NSLog(@"%@",notification.userInfo);
[self performSegueWithIdentifier:@"1_" sender:nil];
}
Same like above way .
Upvotes: 0
Reputation: 3207
Assumed hierarchy:
UINavigation Controller -- UIViewController -- UIPageController
UIPageController (with 2 UIViewController) -- UITableViewController-1 and UITableViewController-2
On didSelectRowAtIndexPath method
UIPageController -- UITableViewController-1 //Selected any one row
Then just push the next view controller onto the current UITableViewController.
Note - Both controller in UIPageController maintain separate life cycle that is independent from each other.
Upvotes: 1