# iOS SDK

## Overview

## Installation

### Dependency Managers

#### Installation with dependency managers

Forter SDK is distributed both on [Swift Package Manager](https://swift.org/package-manager/ "Swift Package Manager") and [CocoaPods](https://cocoapods.org/ "CocoaPods"). The deliverables are the same for both integration methods.

##### Swift Package Manager

If you have used CocoaPods as the integration method previously, please delete pod 'ForterSDK' from the Podfile and run the following commands:

```bash
pod cache clean ForterSDK
pod install --no-repo-update
```

###### Xcode

1. In the **Project Navigator**, select the **Project** and then the **Package Dependencies** tab and click the **+** button.
2. In the search bar, enter https://bitbucket.org/forter-mobile/forter-ios-sdk.git
3. Set the dependency rule to **Up to Next Major Version** and click the "add package" button.

###### Package.swift

To add the **Forter SDK** to your project using Package.swift, include it in your package dependencies:

```swift
dependencies:[
    .package(url:"https://bitbucket.org/forter-mobile/forter-ios-sdk.git", .upToNextMajor(from:"3.2.1"))
]
```

##### CocoaPods

In order to integrate Forter SDK to your project using CocoaPods, please take the following steps:

1. Make sure your Podfile includes the use_frameworks! flag.
2. Add the ForterSDK Pod to the Podfile next to the rest of the frameworks you're using:

```ruby
pod 'ForterSDK',:git =>'https://bitbucket.org/forter-mobile/forter-ios-sdk.git'
```

3. Run pod install

#### Version Updates

##### Swift Package Manager

To update the Forter SDK using Swift Package Manager:

1. In Xcode, go to File > Packages > Update to Latest Package Versions.
2. Xcode will automatically update to the latest version that matches your version rule.

##### Cocoapods

1. In your Podfile, ensure you're not pinned to a specific version:

```ruby
pod 'ForterSDK',:git =>'https://bitbucket.org/forter-mobile/forter-ios-sdk.git','~> 3.2.1' # Use this for the latest minor version
# or
pod 'ForterSDK',:git =>'https://bitbucket.org/forter-mobile/forter-ios-sdk.git' # Use this for the latest version overall
```

2. Run pod update ForterSDK
