Build an Objective-C bindings library with Objective Sharpie - IOS451

Exercise 2: Initiate the binding process on an existing CocoaPod project (IOS451)

The primary goal of this lab is to initiate the binding process on an existing CocoaPod project using Objective Sharpie.

If you haven't already, you will need to download Objective Sharpie. Additionally, you will need to complete this exercise on a Mac running macOS 10.10 or newer for compatiblity with Objective Sharpie.

Objective Sharpie has a minimum requirement of macOS 10.10 or newer.

Make sure CocoaPods is installed

Make sure you have followed the steps in the CocoaPods getting started guide to install CocoaPods support on your macOS development machine.

Note: CocoaPods has a dependency on Ruby.

Alternatively, you can use Homebrew to manage both your Ruby and CocoaPods installation.

  1. Install Homebrew.
  2. Run the following command to make sure Homebrew is up-to-date.
brew up
  1. Run the following command to install Ruby using Homebrew.
brew install ruby
  1. With Ruby installed, run the following command to install CocoaPods.
brew install CocoaPods


Initialize CocoaPods project

To start, we will need to initialize our CocoaPods project with Objective Sharpie.

  1. Create a folder for you exercise content.
  2. Open Terminal and navigate to your exercise folder.
  3. Type the following command to initialize the project through Objective Sharpie.
sharpie pod init ios AFNetworking
Note: the first time you call a CocoaPods command in a new location, which this sharpie command will do indirectly, CocoaPods will need to do several initialization steps that can take a while.

Process library into an API definition

Next, we need to create our API definition with Objective Sharpie.

Run the following command to create the API definition for the CocoaPod library.

sharpie pod bind

The Objective Sharpie run will complete with the creation of 2 files:


Exercise summary

In this exercise you saw how to initiate the binding process on an existing CocoaPod project using Objective Sharpie.

Go Back