CocoaPods is a dependency manager for iOS and macOS projects.
sudo gem install cocoapods
Podfile
in the root directory of your project.Podfile
.pod install
in the terminal.# Uncomment the following line to define a global platform for your project
# platform :ios, '9.0'
target 'MyApp' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Pods for MyApp
pod 'Alamofire'
pod 'SwiftyJSON', '~> 4.0'
end
platform
keyword sets the minimum iOS or macOS version for your project.target
keyword specifies the Xcode target to install the dependencies for.use_frameworks!
keyword enables dynamic framework integration.pod
keyword specifies the name of the dependency and an optional version specifier.pod install
: Installs the dependencies specified in the Podfile
.pod update
: Updates the dependencies to their latest versions.pod search
: Searches the CocoaPods repository for a specific dependency.pod init
: Creates a new Podfile
in the current directory.