CocoaPods manages library dependencies for your Xcode projects.
The dependencies for your projects are specified in a single text file called “Podfile”. CocoaPods resolves dependencies between libraries, fetches necessary code and links it together in an Xcode workspace to build your project.
Make sure you have the Cocoapods ruby gem installed your system. If you don’t, follow the directions from the CocoaPods Getting Started guide, or just launch a Terminal window and run:
$ sudo gem install cocoapods
Creating a new Xcode project with CocoaPods
Before you begin, check the Backendless-ios-SDK folder of CocoaPods Specs repository and choose the version of the library you will use (the latest is recommended unless you have a reason not to use it).
To create a new project with CocoaPods, follow these simple steps:
- Create a new project in Xcode as you normally would, then close this project.
- Open a Terminal window, and $ cd into your project directory.
- Create Podfile. This can be done by running123$ touch Podfile
- Open your Podfile using your favorite text editor (or Xcode), and add the following text:1234platform :ios, '7.0'pod 'Backendless-ios-SDK', '~>1.15.0'
The first line specifies the platform and version supported, the second line specifies the name of the Backendless folder in the CocoaPods Specs repository and the library version you chose.
- Save Podfile, return to the Terminal window and run:123$ pod install
Once all of the pod data is downloaded, Xcode project workspace file will be created. This should be the file you use to create your app.
- Open .xcworkspace file to launch your project, and build it.