| 注册
请输入搜索内容

热门搜索

Java Linux MySQL PHP JavaScript Hibernate jQuery Nginx
jopen
8年前发布

FileBrowser - Swift开发的Finder风格iOS文件浏览器

qq截图20160220150343.png

FileBrowser

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

Features

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.
: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()  self.presentViewController(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)

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', '~> 0.1'

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"


项目地址: https://github.com/marmelroy/FileBrowser

 本文由用户 jopen 自行上传分享,仅供网友学习交流。所有权归原作者,若您的权利被侵害,请联系管理员。
 转载本站原创文章,请注明出处,并保留原始链接、图片水印。
 本站是一个以用户分享为主的开源技术平台,欢迎各类分享!
 本文地址:https://www.open-open.com/lib/view/open1455951418917.html
Apple Swift开发 FileBrowser