First step -> Get CocoaPods install on your Mac.

1
$ sudo gem install cocoapods

once CocoaPods successfully installed,
enter this command to complete the setup.

1
$ pod setup --verbose

Let’s try to create a new project “JustCalc”,
JustCalc-01
JustCalc-02

after project created and saved.
get back into command line,

1
2
$ cd ~/PATH/TO/XCODE/PROJECT/JustCalc
$ pod init

what if you occurs error like following …

JustCalc-03

just try to uninstall old version of nanaimo

1
2
$ sudo gem uninstall nanaimo
# then choose old version to uninstall

JustCalc-04

and then re-issue the pod init command

this will create a Podfile for your project.
you can use any PLAIN-TEXT editor to edit it.(e.g. ATOM)
here I recommended you to edit in Xcode.

1
$ open -a Xcode Podfile

add the pods you need.
in this case, I add 2 of them.
JustCalc-05

save the Podfile,
then install them with following command

1
$ pod install

JustCalc-06

as it said,
you now should close the original Xcode project
and move on with new file JustCalc.xcworkspace file.