MnghaDataSource
is a Swift package that wraps an XCFramework
built using Kotlin Multiplatform Mobile (KMM). This package enables seamless integration of shared Kotlin/Native logic into iOS applications via Swift Package Manager (SPM).
- Easily integrate the Kotlin Multiplatform shared code in your iOS Swift projects.
- Supports iOS projects targeting iOS 13 and above.
- Distributed as a precompiled binary (
MnghaDataSource.xcframework
).
You can add the MnghaDataSource
package to your iOS project using Swift Package Manager (SPM). Follow these steps:
- In Xcode, open your project and navigate to
File > Add Packages...
. - Enter the repository URL:
https://github.com/yourusername/MnghaDataSource.git
. - Select the version you want to use (or choose the latest version).
- Add the package to your project.
After successfully adding the package, you can import the MnghaDataSource
module into your Swift files and begin using the functionality provided by the XCFramework
.
import MnghaDataSource
// Example usage
let myObject = MyMnghaClass() // Replace with actual classes/methods from the framework
- iOS 13.0+
- Swift 5.3+
- Xcode 12.0+
The repository contains the following components:
MnghaDataSource.xcframework
: The precompiled binary framework containing the Kotlin/Native code.Package.swift
: The Swift Package manifest file defining the binary target.
MnghaDataSource/
├── Frameworks/
│ └── MnghaDataSource.xcframework/ <-- The XCFramework (precompiled binary)
├── Sources/
│ └── MnghaDataSource/ <-- Empty (no Swift code in this package)
├── Tests/
│ └── MnghaDataSourceTests/ <-- Optional unit tests
├── Package.swift <-- Swift Package Manager configuration
└── README.md <-- This file
If you need to rebuild the XCFramework
from Kotlin Multiplatform Mobile, follow these steps:
-
Build the iOS ARM and simulator binaries using Kotlin Gradle tasks:
./gradlew assemble
-
Create the XCFramework by bundling the ARM64 and simulator binaries.
-
Place the newly created
MnghaDataSource.xcframework
inside theFrameworks
directory.
Contributions, issues, and feature requests are welcome! Feel free to check the issues page or submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for more information.
This package utilizes Kotlin Multiplatform Mobile (KMM) for sharing business logic between iOS and Android.