Click here to Skip to main content
13,090,730 members (43,448 online)
Click here to Skip to main content
Add your own
alternative version


5 bookmarked
Posted 4 Mar 2014

Using CocoaPods on iOS

, 4 Mar 2014
Rate this:
Please Sign up or sign in to vote.
Configuring and using CocoaPods on iOS projects.


CocoaPods is the dependency manager for Objective-C projects. It has thousands of libraries and can help you scale your projects elegantly. I want to show you how to use in your project.


Check this out and install CocoaPods on your mac :


sudo gem install cocoapods 
pod setup 

Using the Code

First, I created an empty application and added one ViewController with xib. Then, I added a button into View.

After that, you should open Terminal windows on project folder. You have to create Podfile for using pods.

Run this command for creating Podfile of your project:


I want to use TSMessage library for showing little notification views on the top of the screen.

In pico editor, you should write like this:

platform :ios, '7.0'
pod 'TSMessages'  

Press the Control-O and enter name 'Podfile' then hit the enter button for saving pod file. Press Control-X for closing pico editor.

Now, check your project folder and see your Podfile.

Are you ready to install pod? Go on. Run this command on Terminal:

pod install 

This process may take some time, be patient. At the end, you should get result like this:

Go and check your project folder again.

As you see, Pod files and workspace have been created. Close Xcode and run again using .xcworkspace file.

Now you have your project and TSMessage library. Let's use it. :)

You should import TSMessage library into ViewController.


#import "TSMessage.h"

At the beginning of this tutorial, I said, I added one button into the View.

I want to show notification when user clicks the this button.

- (IBAction)sampleButtonClick:(id)sender { 

[TSMessage showNotificationWithTitle:@"Bildirim basligi" 

subtitle:@"Çok fena bir hata aldiniz !!" 



That's it !

Points of Interest

Check the CocoaControls for interesting libraries for iOS.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Melih Mucuk
Software Developer NoMad Commerce
Turkey Turkey
Melih Mucuk

Software & Mobile App Developer

Visit my blog:

You may also be interested in...


Comments and Discussions

-- There are no messages in this forum --
Permalink | Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.170813.1 | Last Updated 4 Mar 2014
Article Copyright 2014 by Melih Mucuk
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid