marmelroy / FileBrowser

Finder-style iOS file browser written in Swift
MIT License
1.51k stars 221 forks source link

It automatically removes the parent view controller? #52

Open ad184hl opened 5 years ago

ad184hl commented 5 years ago

I have a RootViewController which is a UITabBarController;
then I have a NavigationController in this RootViewController;
after that I use self.navigationController?.pushViewController(vc, animated: true) to add a vc: CustomViewController in the NavigationController

Now I have below standard code to call this package in the vc: CustomViewController

let fileBrowser = FileBrowser(initialPath: documentsURL)
present(fileBrowser, animated: true, completion: nil)
fileBrowser.didSelectFile = { (file: FBFile) -> Void in
    // things I do here...
}

However, after I select file and did those things there. The vc: CustomViewController is removed! It directly shows the NavigationController level.

Anyone knows how to fix this? I still need to stay in the vc: CustomViewController.

ad184hl commented 5 years ago

I find an alternative method.

In case someone needs it, please refer the Apple documentation about UIDocumentPickerViewController and UIDocumentBrowserViewController.

Much easier to use and control with native support.