Skip to content

Commit

Permalink
Update README for SPM #11
Browse files Browse the repository at this point in the history
  • Loading branch information
rickclephas committed Oct 31, 2021
1 parent 1eea0c2 commit a451b1f
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ Depending on the implementation you can support as low as iOS 9, macOS 10.9, tvO
## Installation

The library consists of a Kotlin and Swift part which you'll need to add to your project.
The Kotlin part is available on Maven Central and the Swift part can be installed via CocoaPods.
The Kotlin part is available on Maven Central and the Swift part can be installed via CocoaPods
or the Swift Package Manager.

Make sure to always use the same versions for all the libraries!

Expand All @@ -60,7 +61,7 @@ plugins {
}
```

### Swift
### Swift (CocoaPods)

Now for Swift you can choose from a couple of implementations.
Add one or more of the following libraries to your `Podfile`:
Expand All @@ -70,6 +71,23 @@ pod 'KMPNativeCoroutinesRxSwift' # RxSwift implementation
pod 'KMPNativeCoroutinesAsync' # Swift 5.5 Async/Await implementation
```

### Swift (Swift Package Manager)

All Swift implementations are also available via the Swift Package Manager.

> **NOTE:** `KMPNativeCoroutinesAsync` requires Xcode 13.2 which is currently in beta.
> To add the async implementation you should add the `-swift-async-await` suffix to the version.
Just add it to your `Package.swift` file:
```swift
dependencies: [
.package(url: "git@github.com:rickclephas/KMP-NativeCoroutines.git", from: "<version>")
]
```

Or add it in Xcode by going to `File` > `Add Packages...` and providing the URL:
`git@github.com:rickclephas/KMP-NativeCoroutines.git`.

## Usage

Using your Kotlin Coroutines code from Swift is almost as easy as calling the Kotlin code.
Expand Down

0 comments on commit a451b1f

Please sign in to comment.