- Added Cocoapods instructions in Readme.md
This commit is contained in:
parent
d1f7b2ba9b
commit
3f87409f03
36
README.md
36
README.md
|
@ -15,22 +15,46 @@ or do it manually as described below:
|
|||
|
||||
### iOS
|
||||
|
||||
1. Run `npm install react-native-linear-gradient --save`
|
||||
2. Open your project in XCode, right click on `Libraries` and click `Add
|
||||
|
||||
|
||||
|
||||
- Run `npm install react-native-linear-gradient --save`
|
||||
|
||||
Then either:
|
||||
#####Cocoapods
|
||||
add the following line to your Podfile:
|
||||
|
||||
`pod 'BVLinearGradient', :path => ‘../node_modules/react-native-linear-gradient'`
|
||||
|
||||
or:
|
||||
#####Manually
|
||||
|
||||
1. Open your project in XCode, right click on `Libraries` and click `Add
|
||||
Files to "Your Project Name"` Look under `node_modules/react-native-linear-gradient` and add `BVLinearGradient.xcodeproj`. [(Screenshot)](http://url.brentvatne.ca/g9Wp).
|
||||
3. Add `libBVLinearGradient.a` to `Build Phases -> Link Binary With Libraries`
|
||||
2. Add `libBVLinearGradient.a` to `Build Phases -> Link Binary With Libraries`
|
||||
[(Screenshot)](http://url.brentvatne.ca/g9Wp).
|
||||
4. Click on `BVLinearGradient.xcodeproj` in `Libraries` and go the `Build
|
||||
3. Click on `BVLinearGradient.xcodeproj` in `Libraries` and go the `Build
|
||||
Settings` tab. Double click the text to the right of `Header Search
|
||||
Paths` and verify that it has `$(SRCROOT)/../react-native/React` - if it
|
||||
isn't, then add it. This is so XCode is able to find the headers that
|
||||
the `BVLinearGradient` source files are referring to by pointing to the
|
||||
header files installed within the `react-native` `node_modules`
|
||||
directory. [(Screenshot)](http://url.brentvatne.ca/7wE0).
|
||||
5. Whenever you want to use it within React code now you can: `var LinearGradient =
|
||||
|
||||
Then:
|
||||
|
||||
|
||||
- Whenever you want to use it within React code now you can: `var LinearGradient =
|
||||
require('react-native-linear-gradient');`
|
||||
|
||||
**If you're having trouble, you can point your `package.json` at github to see if the issue has been fixed. Simply change the dependency `"react-native-linear-gradient": "brentvatne/react-native-linear-gradient",` and then `npm install`**
|
||||
|
||||
**If you're having trouble, you can point your `package.json` at github to see if the issue has been fixed. Simply change the dependency
|
||||
|
||||
`"react-native-linear-gradient": "brentvatne/react-native-linear-gradient",`
|
||||
|
||||
to get the data right from github instead of npm and then `npm install`**
|
||||
|
||||
For instance the podspec file does not contain the right data (author attributes etc..) in npm while it does in the github repo.
|
||||
|
||||
#### Android
|
||||
|
||||
|
|
Loading…
Reference in New Issue