
Earlier I posted an
article on using RAC. It
was a plain vanilla
example of using RAC.
While I AM working on
a second post with
more useful examples, I
wanted to go over how
to ADD RAC to a
project.
First, you must have ruby installed.
This means, go to Terminal and type in:
which ruby
This is what I get:
…../.rvm/rubies/ruby-2.1.0/bin/ruby
Important to note here that if you don’t have that rvm bit, you might still have ruby. RVM stands for Ruby Version Manager and for what little I know about ruby, its one of the managers available for ruby but there are others.
If you don’t have ruby, you will need to install it. Use this article (http://railsapps.github.io/installrubyonrails-mac.html) but just use the section “Install RUBY using RVM”. DO NOT follow the Xcode Command Line Tools section as that doesn’t work anymore.
For the Xcode Command Line Tools just check this out (http://stackoverflow.com/questions/15371925/how-to-check-if-command-line-tools-is-installed).
Second, you need Cocoapods installed.
This is as simple as typing, again in Terminal:
which pod
If you get some folder, you’re ok. I get:
…../.rvm/rubies/ruby-2.1.0/bin/ruby/pod
Otherwise you will get just the prompt or:
pod not found
So you need to install it. This is a bit easier. You can always refer to this article (http://www.raywenderlich.com/12139/introduction-to-cocoapods) but basically:
Makes sure your gems are up to date by typing in Terminal:
sudo gem update –system
Again, remember Command Line Tools don’t show up in Xcode>Preferences anymore and they don’t install that way either so SKIP that part of this article.
Now type in:
sudo gem install cocoapods
You will see a bunch of stuff and then:
Successfully installed Cocoapods 0.29.0
or something like that.
Now type in:
pod setup
And you will get a master repo created.
Now remember the idea behind this is to be able to download Pods or projects and link them to your project. You know, instead of having to import a downloaded 3rd party project folder and having to link search paths and this and that and the other.
Third, let’s use Cocoapods to install the ReactiveCocoa pod into a project.
For this we will basically follow these general steps and I will do so in a video to make this easier
- Create SingleView project in Xcode
- Create Podfile & Use it to install RAC
- Open the Workspace & configure it
Reblogged this on Sutoprise Avenue, A SutoCom Source.