Monday, 29 August 2016

Install COCOA pods for latest mac OS

sudo gem install activesupport -v 4.2.6
sudo gem install cocoapods

  • Create a new project in Xcode as you would normally.
  • Open a terminal window, and $ cd into your project directory.
  • Create a Podfile. This can be done by running $ pod init.
  • Open your Podfile. The first line should specify the platform and version supported.
                    platform :ios, '9.0'
  • In order to use CocoaPods you need to define the Xcode target to link them to. So for example if you are writing an iOS app, it would be the name of your app. Create a target section by writing target '$TARGET_NAME' do and an end a few lines after.
  • Add a CocoaPod by specifying pod '$PODNAME' on a single line inside your target block.
   target 'MyApp' do    pod 'ObjectiveSugar'       end

  • Save your Podfile.
  • Run $ pod install
  • Open the MyApp.xcworkspace that was created. This should be the file you use everyday to create your app.

<
Integration with an existing workspace

Integrating CocoaPods with an existing workspace requires one extra line in your Podfile. Simply specify the.xcworkspace filename in outside your target blocks like so:
workspace 'MyWorkspace'

pod install

No comments:

Setting Up Multiple App Targets in Xcode from a Single Codebase

 To create two different apps (like "Light" and "Regular") from the same codebase in Xcode, you can follow these steps b...