Update the navbar buttons the room participants & room settings viewcontroller.

This commit is contained in:
yannick
2015-11-27 14:02:37 +01:00
parent 004fdb2491
commit 6073b3a949
2 changed files with 74 additions and 43 deletions
@@ -50,18 +50,15 @@
@implementation RoomParticipantsViewController
- (IBAction)onEdit:(id)sender
- (void)addNavBarButtons
{
// TODO add actions here
}
- (void)addRightNavBarButton
{
// TODO manage other mode than edit
UIBarButtonItem* rightButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemEdit target:self action:@selector(onEdit:)];
// this viewController can be displayed
// 1- with a "standard" push mode
// 2- within a segmentedViewController i.e. inside another viewcontroller
// so, we need to use the parent controller when it is required.
UIViewController* topViewController = (self.parentViewController) ? self.parentViewController : self;
topViewController.navigationItem.rightBarButtonItem = rightButton;
topViewController.navigationItem.rightBarButtonItem = nil;
topViewController.navigationItem.leftBarButtonItem = nil;
}
- (void)viewDidLoad
@@ -114,14 +111,14 @@
// ensure that the separator line is not displayed
self.tableView.separatorColor = [UIColor clearColor];
[self addRightNavBarButton];
[self addNavBarButtons];
}
// this method is called when the viewcontroller is displayed inside another one.
- (void)didMoveToParentViewController:(nullable UIViewController *)parent
{
[super didMoveToParentViewController:parent];
[self addRightNavBarButton];
[self addNavBarButtons];
}
- (void)didReceiveMemoryWarning