mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-29 20:56:57 +02:00
UsersDeviceViewController: Add an onComplete param to the displayUsersDevices method
This commit is contained in:
@@ -26,16 +26,19 @@
|
||||
{
|
||||
MXUsersDevicesMap<MXDeviceInfo*> *usersDevices;
|
||||
MXSession *mxSession;
|
||||
|
||||
void (^onCompleteBlock)(BOOL doneButtonPressed);
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation UsersDevicesViewController
|
||||
|
||||
- (void)displayUsersDevices:(MXUsersDevicesMap<MXDeviceInfo*>*)theUsersDevices andMatrixSession:(MXSession*)matrixSession;
|
||||
- (void)displayUsersDevices:(MXUsersDevicesMap<MXDeviceInfo*>*)theUsersDevices andMatrixSession:(MXSession*)matrixSession onComplete:(void (^)(BOOL doneButtonPressed))onComplete
|
||||
{
|
||||
usersDevices = theUsersDevices;
|
||||
mxSession = matrixSession;
|
||||
onCompleteBlock = onComplete;
|
||||
}
|
||||
|
||||
- (void)finalizeInit
|
||||
@@ -228,12 +231,22 @@
|
||||
|
||||
[self stopActivityIndicator];
|
||||
[self dismissViewControllerAnimated:YES completion:nil];
|
||||
|
||||
if (onCompleteBlock)
|
||||
{
|
||||
onCompleteBlock(YES);
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
- (IBAction)onCancel:(id)sender
|
||||
{
|
||||
[self dismissViewControllerAnimated:YES completion:nil];
|
||||
|
||||
if (onCompleteBlock)
|
||||
{
|
||||
onCompleteBlock(NO);
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - Private methods
|
||||
|
||||
Reference in New Issue
Block a user