Docs

How to Integrate a CocoaPods Library

Add the Grovs SDK to your iOS project using CocoaPods.

CocoaPods is the most common dependency manager for iOS projects. Follow these steps to integrate the Grovs SDK.

If you don't have CocoaPods installed, run sudo gem install cocoapods in Terminal first.

1

Initialize CocoaPods in your project

Open Terminal and navigate to your project directory where your .xcodeproj file is located, then initialize CocoaPods:

Bash
cd /path/to/your/project
pod init

This creates a Podfile in your project directory.

2

Edit your Podfile

Open the Podfile and add the Grovs pod to your target:

Ruby
target 'YourApp' do
  use_frameworks!
 
  pod 'Grovs'
end

Replace 'YourApp' with your actual target name. Save and close the Podfile.

3

Install the pod

In Terminal, run the install command:

Bash
pod install

CocoaPods will download and integrate the Grovs SDK into your workspace.

4

Open your workspace

Close your Xcode project if it's open. From now on, always open the .xcworkspace file:

Bash
open YourProject.xcworkspace
5

Import Grovs in your code

In your Swift files where you need to use the Grovs SDK:

Swift
import Grovs

After installing pods, always use the .xcworkspace file, not the .xcodeproj file. Opening the .xcodeproj directly will result in missing dependencies.