marmelroy/FileBrowser
Fork: 219 Star: 1520 (更新于 2024-11-09 11:09:41)
license: MIT
Language: Swift .
Finder-style iOS file browser written in Swift
最后发布版本: 1.0.0 ( 2017-09-21 13:49:05)
FileBrowser
iOS Finder-style file browser in Swift 4.0 with search, file previews and 3D touch. Simple and quick to use.
Features
:sparkles: | Features |
---|---|
:iphone: | Browse and select files and folders with a familiar UI on iOS. |
:mag: | Pull down to search. |
:eyeglasses: | Preview most file types. Including plist and json. |
:pencil: | Edit/delete files. |
:point_up_2: | 3D touch support for faster previews with Peek & Pop. |
:white_flower: | 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"
最近版本更新:(数据更新于 2024-09-30 13:34:14)
2017-09-21 13:49:05 1.0.0
2017-07-23 19:13:28 0.3.0
2016-09-19 20:29:04 0.2.0
2016-03-24 14:56:33 0.1.4
2016-02-18 04:48:50 0.1.1
2016-02-17 07:37:41 0.1
marmelroy/FileBrowser同语言 Swift最近更新仓库
2024-11-19 05:05:44 whoeevee/EeveeSpotify
2024-11-08 09:08:36 Aidoku/Aidoku
2024-11-07 09:51:16 argmaxinc/WhisperKit
2024-11-01 03:30:19 wordpress-mobile/WordPress-iOS
2024-10-30 03:29:03 jordanbaird/Ice
2024-10-24 02:02:47 Artificial-Pancreas/iAPS