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

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.
1.0.4" ">
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.

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 } } ">
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
Seafile-iOS is a the iOS client for Seafile.

Introduction Seafile-iOS is a the iOS client for Seafile. Build and Run Follow these steps : git clone https://github.com/haiwen/seafile-iOS.git cd se

null 202 Dec 29, 2022
Amahi iOS App, new from scratch, in Swift.

Amahi iOS App Amahi iOS App, new from scratch, in Swift. master beta Requirements iOS 9.0+ Xcode 9.0+ Setup Close Xcode Open a terminal window, and $

Amahi 37 Jul 23, 2022
A modern iOS application for kDrive by Infomaniak.

Infomaniak kDrive app A modern iOS application for kDrive by Infomaniak. Synchronise, share, collaborate. The Swiss cloud that’s 100% secure. ☁️ All t

Infomaniak 27 Nov 1, 2022
📱 Nextcloud iOS App

Nextcloud iOS app Check out https://nextcloud.com and follow us on twitter.com/nextclouders or twitter.com/NextcloudiOS How to contribute If you want

Nextcloud 1.4k Jan 7, 2023
📱The all-new iOS app for ownCloud

ownCloud iOS App ?? The new iOS App for your ownCloud! ?? https://ownCloud.com Account List File List File Actions Preview Files Quick Access Settings

ownCloud 163 Dec 29, 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
🎚️ STDiscreteSlider – slider which allows user to choose value only from predefined set of data.

STDiscreteSlider – slider which allows user to choose value only from predefined set of data. Slider may receive any types of options, you may pass set of integers or strings, or any other type. Written using SwiftUI.

Tamerlan Satualdypov 15 Apr 3, 2022
🔍 RAMReel is a 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
An Integer type that clamps its value to its minimum and maximum instead of over- or underflowing.

ClampedInteger An Integer type that clamps its value to its minimum and maximum instead of over- or underflowing. Examples let big = ClampedIntege

Berik Visschers 0 Jan 17, 2022
UIView subclass that bends its edges when its position changes.

AHKBendableView BendableView is a UIView subclass that bends its edges when its position change is animated. Internally, BendableView contains CAShape

Arek Holko 591 Jul 24, 2022
A UISwitch that infects its superview with its tint color.

UISwitch subclass that 'infects' the parent view with the onTintColor when the switch is turned on. Inspired by this Dribble by Ramotion. Screenshot I

Andrea Mazzini 337 Sep 12, 2022
🎉 WWDC 2021 Swift Student Challenge Winner 🎉 Dance Party allows users to record choreography and play against other users to try and match the key poses!

?? Dance Party ?? ?? WWDC 2021 Swift Student Challenge Winner ?? Installation Steps (Works on iPad Only) Clone or Download Unzip the .playgroundbook.z

Alan Yan 7 Oct 17, 2022
Allows users to pull in new song releases from their favorite artists and provides users with important metrics like their top tracks, top artists, and recently played tracks, queryable by time range.

Spotify Radar Spotify Radar is an iOS application that allows users to pull in new song releases from their favorite artists and provides users with i

Kevin Li 630 Dec 13, 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
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