Netherlandsrickclephas/KMP-NativeCoroutines
Library to use Kotlin Coroutines from Swift code in KMP apps
Thành tựu nổi bật
Những danh hiệu mới nhất của dự án
#1 Repository Của Tuần
#1 Repository Của Tuần
#3 Repository Của Tuần
🔄 Kết nối Kotlin Coroutines với Swift trong KMP apps
Thư viện KMP-NativeCoroutines giải quyết hai giới hạn lớn khi dùng Kotlin Coroutines từ Swift: thiếu hỗ trợ cancellation và mất kiểu generic trên Flow.
Rickclephas phát triển KMP-NativeCoroutines để hỗ trợ gọi Kotlin Coroutines từ Swift một cách tự nhiên trong các dự án Kotlin Multiplatform (KMP). Khi dùng suspend function hoặc Flow từ Swift, Kotlin thường chỉ expose dưới dạng completion handler — tiện nhưng không hủy được (cancel), đặc biệt với async Swift 5.5+ chỉ là syntactic sugar.
✨ Điểm nổi bật
- Hỗ trợ cancellation: Cho phép hủy coroutines từ Swift một cách an toàn.
- Giữ nguyên generic Flow: Giữ lại kiểu dữ liệu gốc của Flow khi chuyển sang Swift.
- Hỗ trợ nhiều implement: Async, Combine, và RxSwift để chọn phù hợp nền tảng.
- Tương thích đa nền tảng: Hỗ trợ iOS, macOS, tvOS, watchOS với yêu cầu phiên bản khác nhau.
- Tích hợp plugin Gradle: Tự động sinh mã thông qua annotation
@NativeCoroutines. - Cài đặt đa dạng: Hỗ trợ SPM, CocoaPods, và plugin IntelliJ.
💡 Vì sao đáng chú ý
KMP-NativeCoroutines khác biệt vì nó không chỉ cải thiện trải nghiệm gọi hàm, mà còn thêm cancellation — tính năng thiết yếu trong lập trình bất đồng bộ. Đặc biệt hữu ích với Flow, nơi mà generic bị mất do giới hạn của ObjC. Dự án phù hợp với mọi dự án KMP cần dùng Kotlin Coroutines từ Swift một cách hiện đại và an toàn.
#KotlinMultiplatform #KotlinCoroutines #Swift #KMP #TiniX
Similar Projects
Discover other similar projects and AI models.
Library to use AndroidX/Kotlin ViewModels with SwiftUI
A library for reading and writing data that lives in network, disk, and memory.
Samples showcasing the Kotlin Multiplatform Jetpack libraries
D-KMP Architecture official sample: it uses a shared KMP ViewModel and Navigation for Compose and SwiftUI apps.
Flutter makes it easy and fast to build beautiful apps for mobile and beyond
A simple zero-config tool to make locally trusted development certificates with any names you'd like.
基于无障碍,高级选择器,订阅规则的自定义屏幕点击安卓应用 | An Android APP with custom screen tapping based on Accessibility, Advanced Selectors, and Subscription Rules
🩵 A free, open-source app store for developers' releases on GitHub, Codeberg & Forgejo — browse, discover, and install apps with one click. Formerly GitHub Store.