Commit 22a26292 authored by Carola Nitz's avatar Carola Nitz

VLCDocumentPickerController: minor codingstyle cleanup

parent 3146a3b6
...@@ -22,28 +22,28 @@ ...@@ -22,28 +22,28 @@
#pragma mark - Internal Methods #pragma mark - Internal Methods
- (UIViewController *) configurePickerViewController { - (UIViewController *)configuredPickerViewController
{
NSArray *types = @[(id)kUTTypeAudiovisualContent]; NSArray *types = @[(id)kUTTypeAudiovisualContent];
UIDocumentPickerMode mode = UIDocumentPickerModeImport; UIDocumentPickerMode mode = UIDocumentPickerModeImport;
if (@available(iOS 11.2, *)) { if (@available(iOS 11.2, *)) {
// UIDocumentMenuViewController deprecated and does not support multiple selection UIDocumentPickerViewController *picker = [[UIDocumentPickerViewController alloc] initWithDocumentTypes:types inMode:mode];
UIDocumentPickerViewController *picker = [[UIDocumentPickerViewController alloc] initWithDocumentTypes: types inMode:mode];
picker.delegate = self; picker.delegate = self;
picker.allowsMultipleSelection = YES; picker.allowsMultipleSelection = YES;
return picker; return picker;
} else { } else {
UIDocumentMenuViewController *importMenu = [[UIDocumentMenuViewController alloc] initWithDocumentTypes:@[(id)kUTTypeAudiovisualContent] inMode:UIDocumentPickerModeImport]; UIDocumentMenuViewController *picker = [[UIDocumentMenuViewController alloc] initWithDocumentTypes:types inMode:mode];
importMenu.delegate = self; picker.delegate = self;
return importMenu; return picker;
} }
} }
- (void)showDocumentMenuViewController:(id)sender - (void)showDocumentMenuViewController:(id)sender
{ {
UIViewController *picker = [self configurePickerViewController]; UIViewController *picker = [self configuredPickerViewController];
UIViewController *rootVC = [UIApplication sharedApplication].keyWindow.rootViewController; UIViewController *rootVC = [UIApplication sharedApplication].keyWindow.rootViewController;
UIPopoverPresentationController *popoverPres = picker.popoverPresentationController; UIPopoverPresentationController *popoverPres = picker.popoverPresentationController;
......
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