Skip to content
Matthew Chung edited this page Aug 7, 2014 · 7 revisions

Getting Started Guide

These step-by-step instructions are written for Xcode 5, using the iOS 7 SDK. If you are using a previous version of Xcode, you may want to update before starting.

Step 1: Download CocoaPods

CocoaPods is a dependency manager for Objective-C, which automates and simplifies the process of using 3rd-party libraries like AFNetworking in your projects.

CocoaPods is distributed as a ruby gem, and is installed by running the following commands in Terminal.app:

$ sudo gem install cocoapods
$ pod setup

Depending on your Ruby installation, you may not have to run as sudo to install the cocoapods gem.

Step 2: Create a Podfile

Project dependencies to be managed by CocoaPods are specified in a file called Podfile. Create this file in the same directory as your Xcode project (.xcodeproj) file:

$ touch Podfile
$ open -e Podfile

TextEdit should open showing an empty file. You just created the pod file and opened it! Ready to add some content to the empty pod file?

On iOS, copy and paste the following lines into the TextEdit window:

platform :ios, '7.0'
pod 'iOS-Rich-Text-Editor' , :git => 'https://github.com/aryaxt/iOS-Rich-Text-Editor.git', :commit => '4ddd86bbd6764d0a052ffa2db4e90037562162d6'
pod 'CodeTextEditor' , :git => 'https://github.com/PunchThrough/CodeTextEditor.git', :tag => '0.0.1'

Make sure the quotes are straight, not slanted/apostrophes. If TextEdit gives you trouble, use Sublime or copy/paste the code above instead of typing it in.

Step 3: Install Dependencies

Now you can install the dependencies in your project:

$ pod install

From now on, be sure to always open the generated Xcode workspace (.xcworkspace) instead of the project file when building your project:

$ open <YourProjectName>.xcworkspace

Step 4: Dive In!

Example Project

Step 1: Clone this repository

$ git clone https://github.com/PunchThrough/CodeViewEditor.git

Step 2: Install Dependencies

Now you can install the dependencies in your project:

$ pod install

From now on, be sure to always open the generated Xcode workspace (.xcworkspace) instead of the project file when building your project:

$ open <YourProjectName>.xcworkspace

Step 3: Add PODS_ROOT to test target

Go to the CodeTextEditorTests target and select Build Settings. Scroll to the bottom and look for the User-Defined section. If there is a PODS_ROOT user defined variable, great. Move on to the next step.

If not, select the CodeTextEditor target and copy the PODS_ROOT variable and paste it as a User-Defined variable into the CodeTextEditorTests target.

Step 4: Dive In!

If you'd like to see more examples of API usage, check out the unit tests.