rn-ios-quicklook-preview

1.1.1 • Public • Published

npm version

rn-files-view-ios

Files viewer component that wraps the iOS QuickLook preview - supports images, pdf, Microsoft office files etc.

Enables pinch to zoom, double tap and swiping between files.

Getting started

$ npm install rn-files-view-ios --save

Mostly automatic installation

$ react-native link rn-files-view-ios

In XCode, in the project navigator, select your project. Add QuickLook.framework to your project's Build PhasesLink Binary With Libraries

Podspec has been updated and linking should be automatic. 'Linking/import' errors that may occur can be solved with importing the package in the Podfile

'pod 'RNFilesViewIos', :path => '../node_modules/rn-files-view-ios''

Usage

import FilesViewIOS from 'rn-files-view-ios';
 
onChangeFile(event) {
  //The currently visible file
  const index = event.nativeEvent.index;
}
 
onPreviewFailed(event) {
  //The failed file url
  const url = event.nativeEvent.url;
}
 
render() {
  return <FilesViewIOS
        style={{ flex: 1 }}
        previewBackgroundColor={"#474A5C"}
        initialIndex={0}
        urls={["file://pathToFile/myfile1.jpeg", "file://pathToFile/myfile2.pdf", "file://pathToFile/myfile3.docx"]}
        onFileChange={this.onChangeFile}
        onPreviewFailed={this.onPreviewFailed}
    />;
}

Thanks

Thanks and mentions go to Guy Blank (github: blankg) - whose work I forked and adapted for my needs.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.1.1
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.1.1
    1

Package Sidebar

Install

npm i rn-ios-quicklook-preview

Weekly Downloads

1

Version

1.1.1

License

MIT

Unpacked Size

19.4 kB

Total Files

14

Last publish

Collaborators

  • shishovic