RoomParticipantsViewController: Add possibility to display cancel bar button.

This commit is contained in:
SBiOSoftWhare 2021-02-21 23:59:50 +01:00
parent 258a27ba2d
commit 4d415bbc02
2 changed files with 16 additions and 1 deletions

View file

@ -84,6 +84,8 @@
*/
@property (nonatomic) BOOL enableMention;
@property (nonatomic) BOOL showCancelBarButtonItem;
/**
The delegate for the view controller.
*/

View file

@ -520,7 +520,15 @@
// Check whether the view controller is currently displayed inside a segmented view controller or not.
UIViewController* topViewController = ((self.parentViewController) ? self.parentViewController : self);
topViewController.navigationItem.rightBarButtonItem = nil;
topViewController.navigationItem.leftBarButtonItem = nil;
if (self.showCancelBarButtonItem)
{
topViewController.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(onCancel:)];
}
else
{
topViewController.navigationItem.leftBarButtonItem = nil;
}
}
- (void)onAddParticipantButtonPressed
@ -1463,6 +1471,11 @@
}
}
- (void)onCancel:(id)sender
{
[self withdrawViewControllerAnimated:YES completion:nil];
}
#pragma mark -
- (void)didSelectInvitableContact:(MXKContact*)contact