iOS Tutorial - How to add ADNKit to your iOS project!

I wrote this tutorial when we were asked to add ADNKit and get it working in a demo app. If there's anything that could make this better, please let me know. 

Step 1.) Figure out where you want the ADNKit library files to sit

Open up your command-line tool (i.e. Terminal) and navigate to where you would like to clone the ADNKit repository. For example, if I'm going to clone the repository into a directory I've named "iOS_libraries" that's inside a directory called "Development", I'm going to enter the following into the terminal:

cd Development/iOS_libraries

Step 2.) Get the clone URL from the GitHub repository

Proceed to ADNKit GitHub project page and on the right-hand side, you'll see the clone url

Step 3.) Clone the ADNKit repository

Switch to your terminal window, that should still be open, and type in

git clone

then paste the clone url after the word "clone" so that it looks like the following, then run the command:

git clone https://github.com/joeldev/ADNKit.git

Note: copying the clone URL from GitHub does not automatically add "git clone" before the URL

Step 4.) Prepare your local ADNKit copy

After the ADNKit repository is done cloning. Proceed to the root of the ADNKit directory. For example, I would enter the following into the terminal to get to the root of the ADNKit directory that I just cloned:

cd adnkit

Why not "cd Development/iOS_libraries/adnkit"? Because you're already sitting in the iOS_libraries directory, so you can just navigate down to the "adnkit" directory.

Next, enter:

git submodule update --init --recursive

Wait until it finishes updating, then proceed to the next step.

Step 5.) Find your local ADNKit copy in Finder

Open up Finder and navigate to where you cloned the ADNKit library. For example, mine would be located in Development/iOS_libraries.

Step 6.) Copy the ADNKit library to your iOS project

If your iOS project is not open, then open it first. With the Finder window opened to your local ADNKit copy, navigate to the Release directory as follows:


 

Then grab the following files (boxed in red) and drag them over to your "Supporting Files" directory


A dialog window will pop-up when you move the files, so make sure the following checkbox is checked for "Copy items into destination group's folder (if needed)" like so before clicking "finish":


Once you copy over the ADNKit library, the following files should be located where you copied them:

Step 7.) Setting up the ADNKit library, finally

Proceed to your "Build Settings" in your iOS project:


Then, let's make this easy, type in "search paths" into the search field:


Look for "Header Search Paths" and "Library Search Paths". Add the ADNKit "Release" directory path to the two search paths:


Scroll back to the search field and type in "other linker flags":


Add -all_load and -ObjC as linker flags:


Proceed to "Build Phases" to add some frameworks that we're going to need in order to finally get ADNKit working:


Scroll down to "Link Binary With Libraries" and add the following frameworks:

Security.framework

SystemConfiguration.framework

MobileCoreServices.framework


After you've added the new frameworks, click on the prefix header file that should be sitting in your "Support Files" directory for your iOS project:


Import the 3 new frameworks you added to the prefix header file.


Then wherever you plan on using the ADNKit library, make sure to import it:

Step 8.) Test it by sending a post to your feed!