# How to integrate a CocoaPods library

> Add the Grovs SDK to your iOS project using CocoaPods.

Source: https://docs.grovs.io/docs/how-to-guides/ios/cocoapods

If CocoaPods isn't installed, run `sudo gem install cocoapods` first.

### 1. Create a Podfile

In the directory that holds your `.xcodeproj`, run:

```bash
cd /path/to/your/project
pod init
```

### 2. Add the Grovs pod

Add Grovs to your target in the `Podfile`. Replace `'YourApp'` with your target name.

```ruby
target 'YourApp' do
  use_frameworks!

  pod 'Grovs', '~> 3.1'
end
```

### 3. Install the pod

```bash
pod install
```

### 4. Open the workspace

Close the Xcode project, then open the `.xcworkspace`:

```bash
open YourProject.xcworkspace
```

### 5. Import Grovs

```swift
import Grovs
```

> **Warning:** After installing pods, always open the `.xcworkspace`. Opening the `.xcodeproj` leaves the dependencies out.
