Add podspec (#409)

* Added a conditional include

Added a conditional include to handle compile if installed using podspec

* Podspec

Using https://github.com/ivpusic/react-native-image-crop-picker/pull/372 as reference added a podspec.

* Update README.md

Add steps to install using Cocoapods

* Update README.md

Add installation step using cocoapods

* Update README.md
This commit is contained in:
Chaitanya Bhagvan 2017-08-11 02:48:07 +05:30 committed by Ivan Pusic
parent d0c481ec74
commit ba6df59d5b
3 changed files with 42 additions and 5 deletions

View File

@ -113,23 +113,39 @@ ImagePicker.clean().then(() => {
## Install
### Install package
```
npm i react-native-image-crop-picker --save
```
You can link the package using react-native link or cocoapods.
###### Manual
```
react-native link react-native-image-crop-picker
```
###### Cocoapods
Add this line to your Podfile and run `pod install`
```
pod 'react-native-image-crop-picker', :path => '../node_modules/react-native-image-crop-picker'
```
#### Post-install steps
##### iOS
In Xcode open Info.plist and add string key `NSPhotoLibraryUsageDescription` with value that describes why do you need access to user photos. More info here https://forums.developer.apple.com/thread/62229. Depending on what features you use, you also may need `NSCameraUsageDescription` and `NSMicrophoneUsageDescription` keys.
###### cocoapods users
###### Cocoapods
- Add `platform :ios, '8.0'` to Podfile (!important)
- Add `pod 'RSKImageCropper'` and `pod 'QBImagePickerController'` to Podfile
You are done.
###### non-cocoapods users
###### Manual
- Drag and drop the ios/ImageCropPickerSDK folder to your xcode project. (Make sure Copy items if needed IS ticked)
- Click on project General tab

View File

@ -21,9 +21,12 @@
#if __has_include("QBImagePicker.h")
#import "QBImagePicker.h"
#import "RSKImageCropper.h"
#else
#elseif __has_include("QBImagePicker/QBImagePicker.h")
#import "QBImagePicker/QBImagePicker.h"
#import <RSKImageCropper/RSKImageCropper.h>
#else
#import "QBImagePickerController/QBImagePickerController.h"
#import <RSKImageCropper/RSKImageCropper.h>
#endif
#import "UIImage-Resize/UIImage+Resize.h"

View File

@ -0,0 +1,18 @@
require "json"
package = JSON.parse(File.read('package.json'))
Pod::Spec.new do |s|
s.name = package['name']
s.version = package['version']
s.summary = package['description']
s.author = "Ivan Pusic"
s.license = package['license']
s.requires_arc = true
s.homepage = "https://github.com/ivpusic/react-native-image-crop-picker"
s.source = { :git => 'https://github.com/ivpusic/react-native-image-crop-picker.git' }
s.platform = :ios, '8.0'
s.source_files = "ios/*.{h,m}", "ios/UIImage-Resize/*.{h,m}"
s.dependency "QBImagePickerController"
s.dependency "RSKImageCropper"
end