Here’s a quick guide to installing CocoaPods, a popular framework integrator. This is a must have for anyone looking to improve their swift applications, because of the vast number of developer-created frameworks available for integrating into your projects.
- You’re going to need root access for this method, so make sure you sign in as an admin. Go into Terminal, and run the command
sudo gem install cocoapods. This installs CocoaPods onto your Mac.
- To use CocoaPods, navigate to your Xcode project directory (folder), and type
pod init. This creates your PodFile, where you can add as many pods as you want.
- Under where it says
# Pods for (your project), paste the pods that you want to install.
- Run the command
pod install. This will install all of your pods.
- After the installation is complete, make sure to open the
.xcworkspacefile when you want to work on your application. This file will contain all of your frameworks.
- If Xcode gives an error about how pods can’t be found, just clean the project (Command-Shift-K) and then build (Command-B). This should clear all errors.
Cocoapods is a great tool to use, especially because more complex apps will rely on frameworks to perform many tasks.