marmelroy / FileBrowser

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

Button for adding new file or folder? #8

Open wtpisaac opened 8 years ago

wtpisaac commented 8 years ago

Hello.

Is there a way to add a new file or folder? Even better, is there a way to tether a custom action to a button in the FileBrowser's top bar?

Thanks!

marmelroy commented 8 years ago

Hey @cyanisaac, this is something I would eventually like to add.

The question is how to do it in a way that is generalised and customisable enough? Still haven't figured it out...

wtpisaac commented 8 years ago

I'm fairly new to iOS, so this might be a terrible idea, but what I would imagine would be good is just to have it so that when you call the File Browser, you can pass in a view controller. If possible, this could be any view controller, meaning the developer of the app could customize it as much as they want.

Then, it would present the view controller from the file browser using self.presentViewController(passedInViewController) (note this could be anything from an UIViewController to an UIAlertViewController)

Then, the presenting view controller would have properties like the directory from which the "add item" button was pressed, so it could react accordingly.

Just my thoughts.

EDIT: Although if you wanted to keep it consistent, you could always make it show an action sheet with "Add Folder" and then list other options that the app passes in.

nami13 commented 8 years ago

Hi, Marmeloy I am very impressed in your FileBrowser. I have a question. Would you like to improve this to allow users to choose Photo/Video/Txts/... from Phone gallery? How can I start FileBrowser from root directory? Hope your reply. Thank you. Nami

\ How can we go to OneUp Higher level directory? Thanks