FileExplorer is a powerful iOS file browser that allows its users to choose and remove files and/or directories

Related tags

Files FileExplorer
Overview

FileExplorer (iOS 9.0+)

👷 Project created and maintained by Rafał Augustyniak. You can find me on twitter (@RaAugustyniak).

Introduction

Twitter: @raaugustyniak CocoaPods Platform License: MIT Swift Version

iOS

FileExplorer is a control designed to provide an easy way to browse and interact with local file system on iOS devices. It works as file browser with additional possibility of deleting specified files and/or directories and possibility to choose files and/or directories.

     | Main Features

---------|--------------- 👉 | Possibility to choose files or/and directories if there is a need for that 🗑 | Possiblity to remove files or/and directories if there is a need for that 🔍 | Built-in search functionality 📚 | Documented 🏠 | Out of the box support for image, audio, video and pdf files 🚀 | Extendable API; Possibility to add support for any file type 🐦 | Written in Swift

Images Audio Files Videos Directories PDFs Preview
iOS iOS iOS iOS iOS iOS

Table of Contents:

Installation

CocoaPods

CocoaPods is the recommended way to add FileExplorer to your project.

  1. Add additional entry to your Podfile.
pod "FileExplorer", "~> 1.0.4"
  1. Install Pod(s) running pod install command.
  2. Include FileExplorer using import FileExplorer.

Source files

  1. Downloaded the latest version of the library using link.
  2. Copy content of the downloaded (and unzipped) zip file into your project by dragging it into Project's navigator files structure.

Basic Usage

Check out the demo for example usage of library. Make sure you read the FileExplorer documentation on Cocoa Docs.

Basics

  1. Add following import in file of your project when you want to use RATreeView:

    import FileExplorer
  2. Simplest way to present File Explorer:

     let fileExplorer = FileExplorerViewController()
    self.present(fileExplorer, animated: true, completion: nil)

Customizations

FileExplorer allows for a lot of customizations. Some of them are discussed below.

Deciding Which Files and/or Directories Should Be Visible

FileExplorerViewController has filters (fileFilters and ignoredFileFilters properties) which can be used to select which files or directories should or shouldn't be displayed to the user.

Specify which files should be visible to the user:

let fileExplorer = FileExplorerViewController()

//Only files with `txt` and `jpg` extensions will be visible
fileExplorer.fileFilters = [Filter.extension("txt"), Filter.extension("jpg")]

self.present(fileExplorer, animated: true, completion: nil)

Specify which files should not be visible to the user:

let fileExplorer = FileExplorerViewController()

//Everything but directories will be visible
fileExplorer.ignoredFileFilters = [Filter.type(.directory)]

self.present(fileExplorer, animated: true, completion: nil)

Combining both types of filters:

let fileExplorer = FileExplorerViewController()

//Only files with `.txt` extension that were modified prior to `referenceDate` will be visible
fileExplorer.fileFilters = [Filter.extension("txt")]
fileExplorer.ignoredFileFilters = [Filter.Filter.modificationDatePastOrEqualTo(referenceDate)]

self.present(fileExplorer, animated: true, completion: nil)

Using FileExplorer as a Way to Choose Files and/or Directories

Configure FileExplorer so that user is allowed to choose files and/or directories:

let fileExplorer = FileExplorerViewController()
fileExplorer.canChooseFiles = true //specify whether user is allowed to choose files
fileExplorer.canChooseDirectories = false //specify whether user is allowed to choose directories
fileExplorer.allowsMultipleSelection = true //specify whether user is allowed to choose multiple files and/or directories
fileExplorer.delegate = self

self.present(fileExplorer, animated: true, completion: nil)

You are informed about choosen files by delegate callback:

public func fileExplorerViewController(_ controller: FileExplorerViewController, didChooseURLs urls: [URL]) {
	//Your code here
}

Deciding Whether User Can Delete Files and/or Directories

Configure FileExplorer so that user is allowed to remove files and/or directories:

let fileExplorer = FileExplorerViewController()
fileExplorer.canRemoveFiles = true //specify whether user is allowed to remove files
fileExplorer.canRemoveDirectories = false //specify whether user is allowed to remove directories

self.present(fileExplorer, animated: true, completion: nil)

Adding Support for Additional File Types

FileExplorer was built with expansibility in mind. It allows its users to register their own file types and provide thumbnails and preview view controllers for them. The whole process is simple and straightforward.

It starts with the implementation of class that conforms to FileSpecificationProvider protocol.

class CustomFileSpecificationProvider: FileSpecificationProvider {
public class var extensions: [String] {
   return ["foo"]
}

public class func thumbnail(forItemAt url: URL, with size: CGSize) -> UIImage? {
   return nil; // FileExplorer uses default thumbnail if nil is returned
}

public class func viewControllerForItem(at url: URL, data: Data?, attributes: FileAttributes) -> UIViewController {
   let viewController = CustomViewController()
   //configure your custom view controller here
   return viewController
}
}

After that, created class must be registered in an instance of FileExplorerViewController class:

let fileExplorer = FileExplorerViewController()
fileExplorer.fileSpecificationProviders = [CustomFileSpecificationProvider.self]

self.present(fileExplorer, animated: true, completion: nil)

That's all! From now on instance of FileExplorerViewController uses CustomFileSpecificationProvider to provide thumbnails and view controllers for files with foo extension.

Documentation

Documentation is available on CocoaPods.

Author

FileExplorer was created by Rafał Augustyniak. You can find me on twitter (@RaAugustyniak).

License

MIT licensed, Copyright (c) 2016 Rafał Augustyniak, @RaAugustyniak

Comments
  • Change iOS Deployment Target to lower SDK levels

    Change iOS Deployment Target to lower SDK levels

    Are there any iOS 10.0 specific API's being used by this library? Would it be possible to lower the deployment target so that legacy projects could make use of this library?

    feature 
    opened by andrewcl 3
  • can't find this project in cocoapods

    can't find this project in cocoapods

    i try

    Saber@SaberdeMacBook-Pro BLEPROJECT$ pod search FileExplorer [!] Unable to find a pod with name, author, summary, or description matching FileExplorer

    and target :BLEPROJECT do pod "FileExplorer", "~> 1.0.4" end

    still can't find this project

    question 
    opened by saber1024 1
  • As a user I would like be able to zoom image

    As a user I would like be able to zoom image

    Acceptance criteria:

    1. Image should stay centered when zoom scale is lesser than 1.0

    Technical details: Implementation of this behavior should be a part of ImageViewController class.

    starter-task feature 
    opened by Augustyniak 1
  • Sending file error using AirDrop

    Sending file error using AirDrop

    Error info:

    Sender kSFOperationEventErrorOccured { Error = "Error Domain=SFOperation Code=-4 \"The transfer failed because there were no valid files to send.\"

    opened by aidevjoe 0
  • Use FileExplorer by Default

    Use FileExplorer by Default

    Is it possible to use the FileExplorer as the main view in an app? Right now, my app opens to a UITableView, but I would like it to open to the FileExplorer view instead (so the user would not have to press a button to show their documents).

    Also, is there a built-in function that allows for the user to switch between saving files locally and in iCloud?

    Thanks!

    opened by grantv9 0
  • code version

    code version

    Language version is swift 3.x

    which is not suitable for xcode 11.0 to convert,

    Xcode was asking to install 10.1 and then convert.

    Kindly see if you can re upload the code or get any alternative

    opened by Ullas9 0
  • Correction for a Warning

    Correction for a Warning

    Hello, First of all I would like to thank you for your nice and helpful tool. I have just a request, if you have time ofcourse. Can you correct the following warning |:

    "Hashable.hashValue' is deprecated as a protocol requirement; conform type 'Item' to 'Hashable' by implementing 'hash(into:)' instead"

    I thank you in advance for your help. George Gerardis

    opened by geogerar 0
  • Support for Swift 4.0 and 4.2

    Support for Swift 4.0 and 4.2

    When I put FileExplorer in Podfile, I run pod install and try to run the project the following error occurs in the XCode log:

    Multiple commands produce

    1. Target 'FileExplorer' (project 'Pods') has copy command from <build_folder>
    2. Target 'FileExplorer' (project 'Pods') has process command with output <build_folder>
    opened by LucasFebatis 2
  • How do I get chosen directory?

    How do I get chosen directory?

    Hi.

    I've used your library for my project, how do I get chosen directory url. Please help me. Following is my code -

    let fileExplorer = FileExplorerViewController()

    fileExplorer.canRemoveFiles = false fileExplorer.canRemoveDirectories = false fileExplorer.canChooseFiles = false fileExplorer.canChooseDirectories = true

    // filter fileExplorer.fileFilters = [Filter.type(.directory)]

    self.present(fileExplorer, animated: true, completion: { print("want to print chosen directory url") })

    Thanks for the library, you've done great work.

    opened by NvVijayakumara 0
Releases(v1.0.4)
  • v1.0.4(Dec 3, 2016)

    • [added] Image stays centered when its zoom scale is lesser than 1.0.
    • [added] Show spinner when file or directory deletion process is in progress.
    • [added] Fetch data of directories and files on background thread.
    Source code(tar.gz)
    Source code(zip)
  • v1.0.3(Dec 2, 2016)

  • v1.0.2(Dec 1, 2016)

  • v1.0.1(Dec 1, 2016)

    • [fixed] Added missing documentation.
    • [fixed] Added view which is displayed when file with unrecognized type is opened.
    • [fixed] Fixed reference screenshots used by FBSnapshotTestCase.
    • [added] Make file that make it super easy to run tests. Use make test to run all tests or make clean to clean build artifacts.
    Source code(tar.gz)
    Source code(zip)
Owner
Rafał Augustyniak
Rafał Augustyniak
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
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
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
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
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
'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
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
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
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
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
🎹 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
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
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
SwiftXLSX - A library focused creating Excel spreadsheet (XLSX) files directly on mobile devices

SwiftXLSX Excel spreadsheet (XLSX) format writer on pure SWIFT. SwiftXLSX is a l

null 19 Dec 13, 2022
FileExplorer is a powerful iOS file browser that allows its users to choose and remove files and/or directories

FileExplorer (iOS 9.0+) ?? Project created and maintained by Rafał Augustyniak. You can find me on twitter (@RaAugustyniak). Introduction FileExplorer

Rafał Augustyniak 717 Dec 19, 2022
Monitor changes to files and directories using kernel event notifications (kqueue) in Swift

SKQueue SKQueue is a Swift libary used to monitor changes to the filesystem. It wraps the part of the kernel event notification interface of libc, kqu

Daniel Pedersen 86 Oct 26, 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
PowerUp is an educational choose-your-own-adventure game that utilizes a users uploaded curriculum to empower pre-adolescents to take charge of their reproductive health.

PowerUp is an educational choose-your-own-adventure game that utilizes a users uploaded curriculum to empower pre-adolescents to take charge of their reproductive health. This is the iOS version of the game.

AnitaB.org Open Source 39 Sep 26, 2022
automatically delete the current project's DerivedData directories

Feature automatically delete the current project's DerivedData directories Usage It will be automatically deleted DerivedData when you run the clean I

Toshihiro Morimoto 242 Dec 16, 2022
Reel Search is a Swift UI controller that allows you to choose options from a list

REEL SEARCH Reel Search is a Swift UI controller that allows you to choose options from a list We specialize in the designing and coding of custom UI

Ramotion 2.5k Dec 21, 2022