cocoapods

While I try to figure out why all the available PODs seem to be written in Objective-C (and not Swift) I need to make notes for using Objective-C (in addition to using CocoaPods) in my iOS App(s).

Pre-Req:

  • Xcode
  • cocoapods
  1. Create (and save) a Project
  2. on a Command Line Shell cd into the location of the App
  3. Run “pod init”
  4. Edit the “Podfile” that is created
    1. add the specific POD Framework entry
    2. Uncomment “use_frameworks!”
  5. Run / execute “pod install” (from the command line)
  6. Close the “Project” and open the “Workspace” (.xcworkspace file)
  7. If the POD Library is in Objectve-C, will need to follow the next few steps (to create a Bridging Header)
    1. Right Click on the Main Folder for the Project and Create / Add a New Objectve-C File (call it anything you want)
    2. Follow the flow till it asks to “Configure an Objective-C bridging header”. Definitely choose / select this option
    3. There should be a couple of files that gets created / generated. Delete (or not) all the files except for the one that ends with “-Bridging-Header.h”
    4. Edit the “-Bridging-Header.h” file to add the “import” for the POD Library
    5. Now to use the POD Library in any class, just add the “import” in the class file(s)
  8. that should do it

– manzoor

Advertisement

Leave a Reply

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

WordPress.com Logo

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

Facebook photo

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

Connecting to %s