Cocoapods is a "CocoaPods is the dependency manager for Swift and Objective-C Cocoa projects. It has almost ten thousand libraries and can help you scale your projects elegantly."
-
Confirm RubyGems installed:
$ gem -vErrors? Download and install here: https://rubygems.org/pages/download
-
Update the gems:
$ sudo gem update --system -
Install Cocoapods:
$ sudo gem install cocoapods*Above command also updates cocoapods
-
Create Xcode Project:
Applications > Xcode > File > New > ProjectSave it in a location of your choice. Such as:
Desktop > Development > you_projectAfter you save it, you'll find:
YourProject > YourProject.xcodeprojYour new project path is:
Desktop/Development/you_project/YourProject/YourProject.xcodeproj -
Create a
Podfile:Locate project's root path:
Desktop/Development/you_project/Then:
$ nano PodfileAdd the follwing to the
Podfile:xcodeproj 'YourProject/YourProject.xcodeproj' source 'https://github.com/CocoaPods/Specs.git' platform :ios, '8.0' use_frameworks! target 'test' do pod 'SwiftyJSON', '~> 2.2.0' pod 'Alamofire', '1.2' #any other frameworks you want to use endSave and close.
-
Install Pod:
$ pod installIf errors run the following:
$ rm -rf ~/.cocoapods$ pod setup$ pod install -
Now you should have a file called
YourProject.xcworkspaceinDesktop/Development/you_project/. This will be the project you work with from now on. -
Add your frameworks to
Linked Frameworks and Librariesin your Xcode Project's settings.
Subscribe on our YouTube Channel and join us for more in-depth tutorials on Django development.
Cheers!