How to import library using cocoa pods

CocoaPods URL

Using CocoaPods is really easy to import Library to our iOS project.

I will show you how to import a library. I use MarqueeLabel as an example.

MarqueeLabel GitHub

First we need instal Ruby.
I use third-party-tool to install it.

Ruby Version Manager (RVM)

Type the following code in Terminal :

\curl -sSL | bash -s stable

After installing Ruby, we need to install CocoaPods now.

sudo gem install cocoapods

If you can't get anything now, maybe your Internet is blocked. I use these to change the install source.

gem sources --remove
gem sources -a

Type this to check

gem sources -l

It will then display :


Run install code again

sudo gem install cocoapods

After the installation completed, use cd command to direct to your project folder. Then, we create a Podfile using vim command

vim Podfile

Type the following

platform :ios, '7.1'
pod 'MarqueeLabel', '~> 1.4.1'

press Exit, and type   :wq    to exit editing with saving

Then install it now

pod install

Now you can open your Xcode (xworkspace)

open YourAppName.xcworkspace

Try to import it in your file

#import "MarqueeLabel.h"

Succeed ?


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s