This summer I got into React Native and absolutely loved it! Coming from an iOS background, it was not too difficult to learn and was hella fun. Although I could build a simple React Native app.. I wanted to dive deeper into React Native and be able to work on more complex apps with fancier UI's. Hence this repo.
This project is inspired by 30 Days of React Native. For the most part, I will be following the projects on the repo pretty closely.
You will need Xcode, node.js, the React Native command line tools, and Watchman.
-
Xcode: Get Xcode from the App Store here
-
node.js:
- If you're using OS X or Windows, the best way to install Node.js is to use one of the installers from the Node.js download page here.
- Or install npm via homebrew like so:
brew install node
-
React Native command line tool:
npm install -g react-native-cli -
Watchman:
brew install watchman -
Finally create a new React Native app:
react-native init ReactNative4Days
Refer to the React Native Getting Started documentation for more information
- Install CocoaPods:
gem install cocoapods - Init the pod file:
cd ios(move into the ios directory within ReactNative4Days folder)pod init
- Add pod to the file:
atom Podfile(or use any other text editor of your choice)- add
pod 'JTSImageViewController'
- Install pod:
pod install - Link Binaries:
- Click on the
ReactNative4Days.xcodeprojon the left and select theReactNative4Daystarget - Go the
Build Phasestab and search forLink Binary with Libraries - Here add the .a file of the cocoapod you just added which is:
libJTSImageViewController.a
- Click on the
Click here for a more detailed guide on how to use CocoaPods
If you are using a react-native version >=0.26.0, you might encounter the following error while trying to run the project using CoacoPods:
std::terminate(), referenced from: ___clang_call_terminate in libReact.a(RCTJSCExecutor.o)
React Native introduced some C++ code so we need to tell Xcode to use those symbols for compile. First click ReactNative4Days.xcodeproj in the Project Navigator to show your project's target (you will have two targets.. app & tests). Then for each of the targets do the following:
- Go the `Build Settings` tab, and make sure `All` is toggled on (instead of `Basic` or `Combined`)
- Look for `Other Linker Flags` and add the flag `-lc++` for all configurations
(credit)
React Native 4 Days is under the MIT license.
Twitter: @Mthakkar_
Website: http://montethakkar.com/
LinkedIn: https://www.linkedin.com/in/montethakkar
Email: mthakkar@mail.sfsu.edu