Done button refresh update

This commit is contained in:
yannick
2015-11-26 18:23:50 +01:00
parent a41d09a625
commit 596b781357
2 changed files with 16 additions and 10 deletions
@@ -48,6 +48,18 @@
@implementation RoomSettingsViewController
- (void)addDoneButton
{
doneButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(onDone:)];
// 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 = doneButton;
}
- (void)viewDidLoad
{
[super viewDidLoad];
@@ -61,21 +73,15 @@
// Setup `RoomSettingsViewController` properties
self.rageShakeManager = [RageShakeManager sharedManager];
[self addDoneButton];
}
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
doneButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(onDone:)];
doneButton.tintColor = VECTOR_GREEN_COLOR;
// 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 = doneButton;
[self addDoneButton];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didMXSessionStateChange:) name:kMXSessionStateDidChangeNotification object:nil];
}