Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Overview

I want to add a JSON Web Token llibrary library to my I am Rich application.

Prerequisite

...

xcode project.

Install Cocoapods


Code Block
> sudo gem install cocoapods

Fetching: cocoapods-core-1.5.3.gem (100%)
Successfully installed cocoapods-core-1.5.3
Fetching: cocoapods-downloader-1.2.1.gem (100%)
Successfully installed cocoapods-downloader-1.2.1
Fetching: molinillo-0.6.6.gem (100%)
Successfully installed molinillo-0.6.6
Fetching: atomos-0.1.3.gem (100%)
Successfully installed atomos-0.1.3
Fetching: nanaimo-0.2.6.gem (100%)
Successfully installed nanaimo-0.2.6
Fetching: xcodeproj-1.6.0.gem (100%)
Successfully installed xcodeproj-1.6.0
Fetching: cocoapods-1.5.3.gem (100%)
Successfully installed cocoapods-1.5.3
Parsing documentation for cocoapods-core-1.5.3
Installing ri documentation for cocoapods-core-1.5.3
Parsing documentation for cocoapods-downloader-1.2.1
Installing ri documentation for cocoapods-downloader-1.2.1
Parsing documentation for molinillo-0.6.6
Installing ri documentation for molinillo-0.6.6
Parsing documentation for atomos-0.1.3
Installing ri documentation for atomos-0.1.3
Parsing documentation for nanaimo-0.2.6
Installing ri documentation for nanaimo-0.2.6
Parsing documentation for xcodeproj-1.6.0
Installing ri documentation for xcodeproj-1.6.0
Parsing documentation for cocoapods-1.5.3
Installing ri documentation for cocoapods-1.5.3
Done installing documentation for cocoapods-core, cocoapods-downloader, molinillo, atomos, nanaimo, xcodeproj, cocoapods after 8 seconds
7 gems installed

...


Add a Podfile


Create a new Podfile using the following command:

Code Block
> pod init
> vi 


This command will create a default Podfile like the followingPodfile:

Code Block
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target 'KeystoneSDKDemo' do
  # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!


  # Pods for KeystoneSDKDemo
  pod 'JSONWebToken'

end

Running 

Code Block
> pod install
Analyzing dependencies
Downloading dependencies
Installing JSONWebToken (2.2.0)
Generating Pods project
Integrating client project
[!] Please close any current Xcode sessions and use `I AM Rich.xcworkspace` for this project from now on.
Sending stats
Pod installation complete! There is 1 dependency from the Podfile and 1 total pod installed.

...


Edit the Podfile and add you import using the pod 'library' syntax as depicted above.


Run pod install to download and add the pod to your project.

Code Block
> pod install


Using a Podfile will require that you use open the code using the workspace instead of the project.

Code Block
> open KeystoneSDKDemo.xcworkspace


References

ReferenceURL
Cocoapods.orghttps://cocoapods.org/

...