UIDocumentBrowserViewController delegate's deprecated method called

After having initialized the UIDocumentBrowserViewController


      UIDocumentBrowserViewController* documentBrowserViewController = [UIDocumentBrowserViewController new];
      
      [documentBrowserViewController setDelegate:self];
      [[self window] setRootViewController:documentBrowserViewController];


the delegate method documentPicker:didPickDocumentsAtURLs: is not called as documented but the deprecated documentBrowser: didPickDocumentURLs: is.

So, what is wrong, the implementation in iOS 12 or the documentation?

Replies

Could you show how you implement the 2 delegate func ?

Of course, you should implement only one.

Deprecated does not mean it does not work. But it won't in the future.

Hi


nothing special

- (void)documentBrowser:(UIDocumentBrowserViewController *)controller
 didPickDocumentURLs:(NSArray<NSURL *> *)documentURLs
{
NSLog(@"documentBrowser:didPickDocumentURLs:");

}

and the same for

documentPicker:didPickDocumentsAtURLs:. Both methods are surrounded with #if 0 or #if 1 to enable / disable the methods.


I just wanted to test UIDocumentBrowserViewController. Therefore, nothing special.