marmelroy / filebrowser Goto Github PK
View Code? Open in Web Editor NEWFinder-style iOS file browser written in Swift
License: MIT License
Finder-style iOS file browser written in Swift
License: MIT License
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
.
When the FIleBrowser view launches, I can't see any files at all. Edit: I now think this is due to app sandboxing? Is there a way to enable access to the phones documents and images?
So I just installed using CocoaPods, and I can see in Xcode that it installed to my project successfully. My problem now is that when I try to import into a swift file, Xcode gives me the error Could not build Objective-C module 'FileBrowser'
.
The only thing I have tried to do with it so far is import it, but I can't even do that. Any ideas?
iOS has native icons for files, different than icons on macOS. Why don't use those icons? You can get icons for a file like this:
let controller = UIDocumentInteractionController(url: <#File URL#>)
controller.icons.last // The icon
UIDocumentInteractionController.icons
I can submit a pull request if you want, it's very easy to implement.
I'm considering using this in an app for debugging purposes while in the while. One of the key things is being able to see the size of the files. I wanted to check to see if you had plans to do this. If not, it's probably something I can extend easily enough. I could code it up if you're interested.
Hello. can we implement file browser to controller view from storyboard directly instead of present. i have issue with it coz its hide my tab bar and also removing cancel button.
thank you
Hi @marmelroy
First of all I would like to appreciate for creating such a nice and cool library.
I am trying to invoke file browser from objective-c class. I am able to achieve this using below code:
FileBrowser *fileBrowser = [[FileBrowser alloc] init];
I want to pass parameters as well using below init method, but it is giving me below error:
init(initialPath: URL? = nil, allowEditing: Bool = false, showCancelButton: Bool = true)
FileBrowser *fileBrowser = [[FileBrowser alloc] init: nil allowEditing: YES showCancelButton: YES]
No visible @interface for 'FileBrowser' declares the selector 'init:allowEditing:showCancelButton:'
Can you please guide me on how to init with parameters. Any help would be very much appreciated.
Thanks
Pranav
I don't see a way to allow the browser to show hidden files.
i.e. files with prefix .
Great project! Thanks for making it.
I put some audio / video in the sample app, seems like it is not shown up. Just wonder if it supports Audio video.
When I import this project, I can use it and everything works (mostly) as expected. My only issue is that I can't delete anything if its in a subdirectory to the initial directory. Is this a bug, or is there some sort of easy fix?
I've been scratching my head for about an hour, and I tried adding fileListViewController.allowEditing = allowEditing
to the function tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath)
, but it doesn't appear to work the way I was hoping.
Hi, what path should i use to get all the files listed on that file browser, like all the files in the phone images, documents and everything
When I try to use FileBrowser and try to create FileBrowser as suggested in README like this: let fileBrowser = FileBrowser()
I get an error: Cannot call value of non-function type 'module'. Importing FileBrowser gives a warning: File 'ViewController.swift' is part of module 'FileBrowser'; ignoring import. Am I missing something fundamentally important?
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!
Hello
Can you please tell me how to use it as an ios app, the proj builds successfully but wont launches.
Any help plz?
Is it possible to show files retrieved from a server? I have a Firebase database from which I download files and wanted to know if it was possible to add files to the FileBrowser or not. Thanks!
sometimes, set the custom didSelectFile, but need to call preview. PreviewManager is useful
Currently, in FileBrowser, you can only exclude extensions. Now, if you have a requirement of only accepting a few extensions, this is going to be a problem as you'll have to exclude all other extensions.
To solve this, I was wondering if a new method could be implemented which allowed only specific extensions to be allowed?
When upgrading to Xcode 10 I get the following error:
dyld: Symbol not found: __T0BOWV
Referenced from: /private/var/containers/Bundle/Application/FE262A78-23EA-4235-87EF-6FBDE57A7457/LinkReactNative.app/Frameworks/FileBrowser.framework/FileBrowser
Expected in: /private/var/containers/Bundle/Application/FE262A78-23EA-4235-87EF-6FBDE57A7457/LinkReactNative.app/Frameworks/libswiftCore.dylib
in /private/var/containers/Bundle/Application/FE262A78-23EA-4235-87EF-6FBDE57A7457/LinkReactNative.app/Frameworks/FileBrowser.framework/FileBrowser
any ideas?
I have added this code into my project. Im wondering how could I add a delete function. I would either need a Path or URL to get NSFileManager to delete
func tableView(tableView: UITableView, commitEditingStyle editingStyle: UITableViewCellEditingStyle, forRowAtIndexPath indexPath: NSIndexPath) {
if (editingStyle == UITableViewCellEditingStyle.Delete) {
}
}
func tableView(tableView: UITableView, canEditRowAtIndexPath indexPath: NSIndexPath) -> Bool {
return true
}
Probably a newbie question but I'm having a hard time getting rid of the rightBarButtonItem entirely. Any help would be much appreciated!
Currently, the component supports installation only through Carthage and CocoaPods. It would be great if we add package definition so that Swift Package Manager could install it as a dependency.
Hi, it possible to add tvOS support
Please update to Swift 3
I am getting "use of unresolved identifier 'present'" error when i copy the code verbatim from the example:
let fileBrowser = FileBrowser()
present(file, animated: true, completion: nil)
Am I doing something wrong?
I am also importing the library at top of file and have run pod install
App crashed when i want to save mp4 on gallery
Hi there, I love the app! I'm new to using Swift & cocoapods and I'm wondering how I could change the name "Documents" at the top of the navigation bar to something else. If you could point me in the right direction that would be awesome! Thanks
Hi,
Thanks for a great piece of coding, works almost exactly how I want.
Is it possible to re-sort the table to display the files by the creation date or date modified? Either as a direct change to code or as an add-in option?
Hello
I am getting this error use of unresolved identifier 'PreviewManager'.
I have swift 2.3 and filebrowser (0.1.4)
Display just blank screen and below warning
2016-06-28 20:52:04.797 FIleBrowserDemo[2533:43383] Warning: Attempt to present <FileBrowser.FileBrowser: 0x7fbe4b849a00> on <FIleBrowserDemo.ViewController: 0x7fbe4a5a9230> whose view is not in the window hierarchy!
import UIKit
import FileBrowser
class ViewController: UIViewController {
let fileBrowser = FileBrowser()
override func viewDidLoad() {
super.viewDidLoad()
self.presentViewController(fileBrowser, animated: true, completion: nil)
// Do any additional setup after loading the view, typically from a nib.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
Hi,
First of all I would like to thank you for the fantastic code.
Really it's a very nice tool.
I use it in my apps.
Now, I get the warning: "/Users/geogerar/Documents/geoWarApp_IOS10_Improved/geoWarApp/Helper_Classes/FileExplorer/Item.swift:99:9: 'Hashable.hashValue' is deprecated as a protocol requirement; conform type 'Item' to 'Hashable' by implementing 'hash(into:)' instead"
is it possible for you to correct this issue...?
Thank you in advance
George
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.