stremio-core-swift
is a wrapper for Apple operating systems, based on stremio-core-kotlin
. Any changes that are not specific to Apple should be contributed to stremio-core-kotlin
.
To integrate stremio-core-swift
into your project, simply add it as a Swift Package Manager (SPM) package. It will automatically handle everything for you:
- Protobuf will be generated at Xcode compile time.
- The compiled Rust binary will be fetched from the releases.
To compile the Rust binary on your macOS machine, follow these steps:
-
Install Apple Rust Dependencies:
Run the following command to install the necessary dependencies:
Support/installDependencies.command
-
Compile rust code:
make all
-
Define the XCFramework in
Package.swift
:Uncomment the local binary target in the Package.swift file:
.binaryTarget(name: "XCFramework", path: ".build/StremioCore.xcframework") //.binaryTarget(name: "XCFramework", url: url, checksum: sha256)
-
Add the Local Package in Xcode:
Finally, add the package as a local package in Xcode.