Finder-style iOS file browser written in Swift

Related tags

Files FileBrowser
Overview

FileBrowser - iOS Finder-style file browser in Swift

Build Status Version Carthage compatible

FileBrowser

iOS Finder-style file browser in Swift 4.0 with search, file previews and 3D touch. Simple and quick to use.

Features

Features
📱 Browse and select files and folders with a familiar UI on iOS.
🔍 Pull down to search.
👓 Preview most file types. Including plist and json.
📝 Edit/delete files.
👆 3D touch support for faster previews with Peek & Pop.
💮 Fully customizable.

Usage

Import FileBrowser at the top of the Swift file.

import FileBrowser

To show the file browser, all you need to do is:

let fileBrowser = FileBrowser()
present(fileBrowser, animated: true, completion: nil)

By default, the file browser will open in your app's documents directory. When users select a file, a preview will be displayed - offering an action sheet of options based on the file type.

Advanced Usage

You can open FileBrowser in a different root folder by initialising with an NSURL file path of your choice.

let fileBrowser = FileBrowser(initialPath: customPath)

You can also allow editing/deleting files.

let fileBrowser = FileBrowser(initialPath: customPath, allowEditing: true)

Use the didSelectFile closure to change FileBrowser's behaviour when a file is selected.

fileBrowser.didSelectFile = { (file: FBFile) -> Void in
    print(file.displayName)
}

To exclude a certain file type or a specific file path:

fileBrowser.excludesFileExtensions = ["zip"]
fileBrowser.excludesFilepaths = [secretFile]

Setting up with CocoaPods

source 'https://github.com/CocoaPods/Specs.git'
pod 'FileBrowser', '~> 1.0'

Setting up with Carthage

Carthage is a decentralized dependency manager that automates the process of adding frameworks to your Cocoa application.

You can install Carthage with Homebrew using the following command:

$ brew update
$ brew install carthage

To integrate FileBrowser into your Xcode project using Carthage, specify it in your Cartfile:

github "marmelroy/FileBrowser"
Comments
  • Xcode error: Cannot call value of non-function type 'module<FileManager>'. What am I doing wrong?

    Xcode error: Cannot call value of non-function type 'module'. What am I doing wrong?

    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?

    opened by bogdankosh 5
  • use of unresolved identifier 'present'

    use of unresolved identifier 'present'

    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

    opened by uknowmeright 5
  • Adding slide to delete to file browser

    Adding slide to delete to file browser

    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
        }
    
    opened by leongwq 2
  • Can the file browser also include the size of the file?

    Can the file browser also include the size of the file?

    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.

    opened by patzearfoss 2
  • How to invoke init with parameters in objective-c?

    How to invoke init with parameters in objective-c?

    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

    opened by prscX 1
  • Add default tableViewController editing / delete support

    Add default tableViewController editing / delete support

    By specifying a boolean in a new custom init method, it passes along a boolean into the FileListViewController which in turn set allowEditing on the tableView. Where I'm not sure things are going to be super smooth is re-parsing of the files and storage variables in the tableView's commit editing style delegate method. In a future version, this might need to be done on a background thread with an activity view display.

    opened by orff 1
  • How to change name of Navigation bar

    How to change name of Navigation bar

    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

    opened by LieutenantKernel 1
  • Not working with Xcode 7.3.1 !

    Not working with Xcode 7.3.1 !

    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!

    simulator screen shot 28-jun-2016 8 53 58 pm

    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.
    }
    

    }

    opened by indrajitsinh 1
  • codebeat badge

    codebeat badge

    Is it fine to add codebeat badge to README?

    codebeat is automated code review tool for Swift, Ruby & Go that helps get instant feedback on code quality.

    "Quick wins" suggested by codebeat could be a nice candidate for a pull request and help other developers become contributors.

    FYI. To be fully open and honest. I'm co-founder of codebeat

    opened by korzonek 1
  • Could not build Objective-C module 'FileBrowser'

    Could not build Objective-C module 'FileBrowser'

    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?

    opened by Emperor-Koala 0
  • Swift Package Manager support

    Swift Package Manager support

    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.

    opened by LeonidKokhnovich 1
  • warning in Xcode 10

    warning in Xcode 10

    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

    opened by geogerar 0
Releases(1.0.0)
Owner
Roy Marmelstein
Ya tu sabes.
Roy Marmelstein
Edit a file, create a new file, and clone from Bitbucket in under 2 minutes

Edit a file, create a new file, and clone from Bitbucket in under 2 minutes When you're done, you can delete the content in this README and update the

Nikunj Munjiyasara 0 Nov 9, 2021
zip file I/O library for iOS, macOS and tvOS

ZipZap is a zip file I/O library for iOS, macOS and tvOS. The zip file is an ideal container for compound Objective-C documents. Zip files are widely

Glen Low 1.2k Dec 27, 2022
'Root' filesystem File Provider extension for iOS.

RootFSProvider This sample project was previously available on on Patreon. It is written in Objective-C, and has not been updated for newer APIs since

Steven Troughton-Smith 14 Sep 24, 2022
Zero-setup P2P file transfer between Macs and iOS devices

?? Ares Zero-setup* P2P file transfer between Macs and iOS devices Ares is a service that I built in under 24 hours, winning first place at HackED 201

Indragie Karunaratne 131 Jan 10, 2022
FileKit is a Swift framework that allows for simple and expressive file management.

FileKit is a Swift framework that allows for simple and expressive file management.

Nikolai Vazquez 2.2k Jan 7, 2023
File management and path analysis for Swift

Pathos offers cross-platform virtual file system APIs for Swift. Pathos is implement from ground-up with on each OS's native API. It has zero dependen

Daniel Duan 104 Nov 19, 2022
A micro-framework for observing file changes, both local and remote. Helpful in building developer tools.

KZFileWatchers Wouldn't it be great if we could adjust feeds and configurations of our native apps without having to sit back to Xcode, change code, r

Krzysztof Zabłocki 1k Dec 19, 2022
🎹 MIDIKit extension for SMF (Standard MIDI File)

?? SMF (Standard MIDI File) Extension for MIDIKit This extension adds abstractions for reading and writing Standard MIDI Files. Getting Started Add MI

Steffan Andrews 3 Aug 30, 2022
RavynOS File manager built in Cocoa/Appkit and ObjC

Filer A file manager and re-implementation of macOS's Finder. A key component of ravynOS, Filer is the first application you see after you start ravyn

RavynSoft 8 Oct 3, 2022
NV_MVVM-C is a template file generator. This can reduce the time taken to write the boilerplate code and create the files.

NV_MVVM-C Template, is an MVVM-C Boilerplate generator which will help you generate all the necessary files for your project architected in MVVM-C.

Nikhil Vinod 9 Sep 6, 2022
ZipArchive is a simple utility class for zipping and unzipping files on iOS, macOS and tvOS.

SSZipArchive ZipArchive is a simple utility class for zipping and unzipping files on iOS, macOS and tvOS. Unzip zip files; Unzip password protected zi

ZipArchive 5.2k Jan 2, 2023
FileManager replacement for Local, iCloud and Remote (WebDAV/FTP/Dropbox/OneDrive) files -- Swift

This Swift library provide a swifty way to deal with local and remote files and directories in a unified way. This library provides implementaion of W

Amir Abbas Mousavian 890 Jan 6, 2023
Effortless path operations in Swift

PathKit Effortless path operations in Swift. Usage let path = Path("/usr/bin/swift") Joining paths let path = Path("/usr/bin") + Path("swift") Determi

Kyle Fuller 1.4k Jan 5, 2023
Effortless ZIP Handling in Swift

ZIP Foundation is a library to create, read and modify ZIP archive files. It is written in Swift and based on Apple's libcompression for high performa

Thomas Zoechling 1.9k Dec 27, 2022
Swift framework for zipping and unzipping files.

Zip A Swift framework for zipping and unzipping files. Simple and quick to use. Built on top of minizip. Usage Import Zip at the top of the Swift file

Roy Marmelstein 2.3k Dec 30, 2022
Swift framework to connect SMB2/3 shares

AMSMB2 This is small Swift library for iOS, macOS and tvOS which wraps libsmb2 and allows to connect a SMB2/3 share and do file operation. Install Coc

Amir Abbas Mousavian 157 Dec 19, 2022
Mouse Finder is a fun replacement for the system Finder icon in the Dock.

Mouse Finder Mouse Finder is a fun replacement for the system Finder icon in the Dock. It mostly works exactly like the system icon, with one importan

Neil Sardesai 432 Dec 22, 2022
Capacitor File Opener. The plugin is able to open a file given the mimeType and the file uri

Capacitor File Opener. The plugin is able to open a file given the mimeType and the file uri. This plugin is similar to cordova-plugin-file-opener2 without installation support.

Capacitor Community 32 Dec 21, 2022
A property finder application written using React Native

React Native PropertyFinder App This repository accompanies the tutorial I published on Ray Wenderlich's website, which describes the process of build

Colin Eberhardt 276 Aug 14, 2022
Erik is an headless browser based on WebKit. An headless browser allow to run functional tests, to access and manipulate webpages using javascript.

Erik Erik is a headless browser based on WebKit and HTML parser Kanna. An headless browser allow to run functional tests, to access and manipulate web

Eric Marchand 544 Dec 30, 2022