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
- Create (and save) a Project
- on a Command Line Shell cd into the location of the App
- Run “pod init”
- Edit the “Podfile” that is created
- add the specific POD Framework entry
- Uncomment “use_frameworks!”
- Run / execute “pod install” (from the command line)
- Close the “Project” and open the “Workspace” (.xcworkspace file)
- If the POD Library is in Objectve-C, will need to follow the next few steps (to create a Bridging Header)
- Right Click on the Main Folder for the Project and Create / Add a New Objectve-C File (call it anything you want)
- Follow the flow till it asks to “Configure an Objective-C bridging header”. Definitely choose / select this option
- 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”
- Edit the “-Bridging-Header.h” file to add the “import” for the POD Library
- Now to use the POD Library in any class, just add the “import” in the class file(s)
- that should do it
– manzoor