Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Support for React Native Projects #42

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions FileBrowser.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ Pod::Spec.new do |s|
s.source_files = "FileBrowser"
s.resources = "FileBrowser/Resources/*.*"
s.pod_target_xcconfig = { 'SWIFT_VERSION' => '4.0' }
s.swift_version = '4.1'

# s.public_header_files = 'Pod/Classes/**/*.h'
s.frameworks = 'QuickLook', 'WebKit'
Expand Down
2 changes: 1 addition & 1 deletion FileBrowser/FBFile.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import Foundation
/// File attributes (including size, creation date etc).
open let fileAttributes: NSDictionary?
/// NSURL file path.
open let filePath: URL
@objc open let filePath: URL
// FBFileType
open let type: FBFileType

Expand Down
6 changes: 3 additions & 3 deletions FileBrowser/FileBrowser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ open class FileBrowser: UINavigationController {
var fileList: FileListViewController?

/// File types to exclude from the file browser.
open var excludesFileExtensions: [String]? {
@objc open var excludesFileExtensions: [String]? {
didSet {
parser.excludesFileExtensions = excludesFileExtensions
}
Expand All @@ -30,7 +30,7 @@ open class FileBrowser: UINavigationController {
}

/// Override default preview and actionsheet behaviour in favour of custom file handling.
open var didSelectFile: ((FBFile) -> ())? {
@objc open var didSelectFile: ((FBFile) -> ())? {
didSet {
fileList?.didSelectFile = didSelectFile
}
Expand All @@ -48,7 +48,7 @@ open class FileBrowser: UINavigationController {
/// - initialPath: NSURL filepath to containing directory.
/// - allowEditing: Whether to allow editing.
/// - showCancelButton: Whether to show the cancel button.
public convenience init(initialPath: URL? = nil, allowEditing: Bool = false, showCancelButton: Bool = true) {
@objc public convenience init(initialPath: URL? = nil, allowEditing: Bool = false, showCancelButton: Bool = true) {

let validInitialPath = initialPath ?? FileParser.sharedInstance.documentsURL()

Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,10 @@ To integrate FileBrowser into your Xcode project using Carthage, specify it in y
```ogdl
github "marmelroy/FileBrowser"
```


## Third Party Bindings

### React Native
You may now use this library with [React Native](https://github.com/facebook/react-native) via the module [here](https://github.com/prscX/react-native-file-selector)