This is a supplement to the official tutorials.
To add RAC to your application:
- Add the Reactivecocoa repository as a submodule of your application ' s repository.
- First you have to have a git to create a git for your project.
-
$ git submodule add https://github.com/ReactiveCocoa/ReactiveCocoa.git external/ReactiveCocoa$ git add .gitmodules external/ReactiveCocoa$ git commit -m "Add ReactiveCocoa as a submodule"
- Run from
script/bootstrap within the Reactivecocoa folder.
- You need to enter SH here (just type "sh" in the terminal)
- CD to the directory where the script is located, type the script file name
- Drag and drop into
ReactiveCocoaFramework/ReactiveCocoa.xcodeproj your application ' s Xcode project or workspace.
- On the ' Build phases ' tab of your application target, add RAC to the ' Link Binary with Libraries ' phase.
- On IOS, add
libReactiveCocoa-iOS.a . (I didn't find this thing, so I added reactivecocoa.framework)
- On OS X, add
ReactiveCocoa.framework . RAC must also is added to any "Copy frameworks" build phase. If you don ' t already has one, simply add a "Copy Files" build phase and target the "frameworks" destination.
- Add
"$(BUILD_ROOT)/../IntermediateBuildFilesPath/UninstalledProducts/include" $(inherited) to the ' Header Search Paths ' build setting (this was only necessary for archive builds and it has no negative eff ECT otherwise).
- For IOS targets, add to
-ObjC the ' other Linker Flags ' build setting.
- If you added RAC-to-a project (not a workspace), you'll also need to add the appropriate RAC target to the "Tar Get Dependencies "of your application.
If you would prefer to use CocoaPods, there is some Reactivecocoa podspecs that has been generously contributed by third Parties. (originally thought oneself has cocoapods will be very convenient, got a half-day not fix, had to press the above steps)
To see a project already set up with RAC, check out C-41 or grocerylist, which is real IOS apps written using Reactivecoc Oa.
Add Reactivecocoa to your project