Commit becb3cb0 authored by Felix Paul Kühne's avatar Felix Paul Kühne

VLCEmbeddedDialogProvider: fix runtime exception on iOS/tvOS 11

parent 74a2f835
......@@ -36,6 +36,7 @@
- (void)displayQuestion:(NSArray * _Nonnull)dialogData;
- (void)displayProgressDialog:(NSArray * _Nonnull)dialogData;
- (void)updateDisplayedProgressDialog:(NSArray * _Nonnull)dialogData;
- (void)dismissCurrentDialogViewController;
@end
......@@ -119,7 +120,10 @@ static void cancelCallback(void *p_data,
libvlc_dialog_id *p_id)
{
@autoreleasepool {
[[[[UIApplication sharedApplication].delegate.window rootViewController] presentedViewController] dismissViewControllerAnimated:YES completion:nil];
VLCEmbeddedDialogProvider *dialogProvider = (__bridge VLCEmbeddedDialogProvider *)p_data;
[dialogProvider performSelectorOnMainThread:@selector(dismissCurrentDialogViewController)
withObject:nil
waitUntilDone:NO];
}
}
......@@ -302,4 +306,9 @@ static void updateProgressCallback(void *p_data,
VKLog(@"%s: %@", __PRETTY_FUNCTION__, dialogData);
}
- (void)dismissCurrentDialogViewController
{
[[[[UIApplication sharedApplication].delegate.window rootViewController] presentedViewController] dismissViewControllerAnimated:YES completion:nil];
}
@end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment