Thursday, September 22, 2016

Pod install in iOS Project (Objective c & Swift)

Flow of pod install in iOS project

In Terminal,
sudo gem install cocoa pods

// Xcode project file path
cd  /Users/yuvaraj.m/Documents/Sample/RealmDB 

//create the podfile
touch pod file

//Open the podfile
open -e pod file

//pod installation
pod install

//pod install take more time mean quit and use the below code.
pod install --no-repo-update

CocoaPods is used to install and manage dependencies in existing Xcode projects.
  1. Create an Xcode project, and save it to your local machine.
  2. Create a file named Podfile in your project directory. This file defines your project's dependencies, and is commonly referred to as a Podspec.
  3. Open Podfile, and add your dependencies. A simple Podspec is shown here:
    # Uncomment this line to define a global platform for your project
    platform :ios, '8.0'
    # Uncomment this line if you're using Swift
    use_frameworks!
    pod 'Google/SignIn'
    pod 'Popover'
    pod 'ObjectMapper', '~> 1.3'
    pod 'Alamofire', '~> 3.4'
    pod 'SwiftyJSON'
  4. Save the file.
  5. Open a terminal and cd to the directory containing the Podfile.
    $ cd <path-to-project>/project/
  6. Run the pod install command. This will install the SDKs specified in the Podspec, along with any dependencies they may have.
    $ pod install
  7. Open your app's .xcworkspace file to launch Xcode. Use this file for all development on your app.

No comments:

Post a Comment