Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
KMP の Swift export
Search
Koki Hirokawa
October 02, 2025
Technology
0
530
KMP の Swift export
extension DC 2025 Day2 @Sansan
※ 2025/10/2 現在、Swift export のステータスは experimental です
Koki Hirokawa
October 02, 2025
Tweet
Share
More Decks by Koki Hirokawa
See All by Koki Hirokawa
SwiftUI移行のためのインプレッショントラッキング基盤の構築
kokihirokawa
0
360
App内課金におけるトラブルを劇的に減らすための取り組み
kokihirokawa
2
1.2k
ABEMAのリアーキテクチャ
kokihirokawa
5
5.2k
Detect Body and Hand Pose with Vision
kokihirokawa
0
940
Other Decks in Technology
See All in Technology
Entity Framework Core におけるIN句クエリ最適化について
htkym
0
130
意外と知らない状態遷移テストの世界
nihonbuson
PRO
1
260
投資戦略を量産せよ 2 - マケデコセミナー(2025/12/26)
gamella
0
440
日本の AI 開発と世界の潮流 / GenAI Development in Japan
hariby
1
480
ActiveJobUpdates
igaiga
1
320
日本Rubyの会: これまでとこれから
snoozer05
PRO
6
240
AI駆動開発の実践とその未来
eltociear
2
500
特別捜査官等研修会
nomizone
0
580
Strands AgentsとNova 2 SonicでS2Sを実践してみた
yama3133
1
1.9k
_第4回__AIxIoTビジネス共創ラボ紹介資料_20251203.pdf
iotcomjpadmin
0
140
AIBuildersDay_track_A_iidaxs
iidaxs
4
1.4k
Kiro を用いたペアプロのススメ
taikis
4
1.9k
Featured
See All Featured
My Coaching Mixtape
mlcsv
0
13
New Earth Scene 8
popppiees
0
1.2k
Optimising Largest Contentful Paint
csswizardry
37
3.5k
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
51
Paper Plane (Part 1)
katiecoart
PRO
0
2.1k
The Language of Interfaces
destraynor
162
25k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.3k
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
1
1.3k
[SF Ruby Conf 2025] Rails X
palkan
0
640
The browser strikes back
jonoalderson
0
130
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
170
ラッコキーワード サービス紹介資料
rakko
0
1.8M
Transcript
KMP ͷ Swift export 2025/10/2 extension DC 2025 Day2 @Sansan
Koki Hirokawa
@pihero13 KokiHirokawa Sony Honda Mobility Inc. 1
Swift export ͱ Experimental Objective-C Λհͣ͞ʹ Swift ͔Β Kotlin Ͱॻ͔ΕͨॲཧΛݺͼग़ͨ͢Ίͷٕज़
2
ΞδΣϯμ KMP ͱ Objective-C export ͱ Swift export ͱ Objective-C
export ͱ Swift export ͷҧ͍ ·ͱΊ 3
KMP ͱ
KMP - ֓ཁ Kotlin Multiplatform KMP Λ༻͢ΔͱҟͳΔϓϥοτϑΥʔϜؒͰ Kotlin ίʔυΛڞ༗Ͱ͖Δ 5
KMP - ରԠϓϥοτϑΥʔϜ Android JVM iOS macOS Linux ... 6
Objective-C export ͱ
KMP - Apple platform 8
KMP - Apple platform 9
KMP - Apple platform 10
KMP - Apple platform 11
Objective-C header 12
Objective-C header 13
Objective-C export 14
Objective-C export Objective-C ͷϔομʔΛಡΉඞཁ͕͋Δ ͯ͢ͷ I/F ͕1ͭͷϔομʔʹ·ͱ·Δ Swift Β͘͠ͳ͍ API
͕ఏڙ͞ΕΔ͜ͱ͕͋Δ γʔϜϨεʹ౷߹Ͱ͖ͳ͍ 15
Swift export ͱ
Swift export Experimental 17
Swift export Experimental Kotlin Multiplatform Development Roadmap for 2024 ϩʔυϚοϓʹొ
18
Swift export Experimental Kotlin Multiplatform Development Roadmap for 2024 ϩʔυϚοϓʹొ
Kotlin Multiplatform Development Roadmap for 2025 ٸϐονͰ։ൃத 2025ͷඪ࠷ॳͷެ։൛ϦϦʔε 19
Swift export Experimental Kotlin Multiplatform Development Roadmap for 2024 ϩʔυϚοϓʹొ
Kotlin Multiplatform Development Roadmap for 2025 ٸϐονͰ։ൃத 2025ͷඪ࠷ॳͷެ։൛ϦϦʔε Kotlin 2.1.0 ॳظஈ֊ͷެ։ 20
Swift export Experimental What’s Next for Kotlin Multiplatform and Compose
Multiplatform – August 2025 Update suspend function Flow ͱ͍ͬͨඇಉظॲཧͷαϙʔτ 2026ʹ҆ఆ൛ͷϦϦʔεΛࢦ͢ 21
Swift export Experimental What’s Next for Kotlin Multiplatform and Compose
Multiplatform – August 2025 Update suspend function Flow ͱ͍ͬͨඇಉظॲཧͷαϙʔτ 2026ʹ҆ఆ൛ͷϦϦʔεΛࢦ͢ Kotlin 2.2.20 Experimental support 22
Swift export ͷ։ൃঢ়گ Experimental https://docs.google.com/spreadsheets/d/ 157wQt05ZyaJAP_P1wigXDs6nW9q7clqbpIDAfMrFhOg/ 23
Objective-C export ͱ Swift export ͷҧ͍
Top-level function Experimental Kotlin // Common.kt fun sharedFunction(): Int =
5 Objective-C export import Shared CommonKt.sharedFunction() Swift export import Shared sharedFunction() 25
Multi-module support Experimental Kotlin // Common.kt (Shared) fun sharedFunction(): Int
= 5 // Common.kt (module-a) fun sharedFunction(): Int = 10 Objective-C export import Shared CommonKt.sharedFunction() CommonKt_.sharedFunction() Swift export import Shared import ModuleA Shared.sharedFunction() ModuleA.sharedFunction() 26
Multi-module support Experimental Objective-C export // Shared.h __attribute__((objc_subclassing_restricted)) __attribute__((swift_name("CommonKt"))) @interface
SharedCommonKt : SharedBase + (int32_t)sharedFunction __attribute__((swift_name("sharedFunction()" ))); @end __attribute__((objc_subclassing_restricted)) __attribute__((swift_name("CommonKt_"))) @interface SharedCommonKt_ : SharedBase + (int32_t)sharedFunction __attribute__((swift_name("sharedFunction()" ))); @end Swift export // Shared.swift public func sharedFunction() -> Swift.Int32 { ExportedKotlinPackages.com.github.jetbrains. swiftexport.sharedFunction() } // ModuleA.swift public func sharedFunction() -> Swift.Int32 { ExportedKotlinPackages.com.github.jetbrains. modulea.sharedFunction() } 27
Package support Experimental Kotlin // MODULE: shared // FILE: Common.kt
package com.github.jetbrains.swiftexport fun sharedFunction(): Int = 5 // MODULE: shared // FILE: Common.kt package com.github.jetbrains.swiftexport.packagea fun sharedFunction(): Int = 10 28
Package support Experimental Objective-C export import Shared CommonKt.sharedFunction() CommonKt.sharedFunction_() Swift
export import Shared sharedFunction() packagea.sharedFunction() 29
Package support Experimental // ExportedKotlinPackages.swift public enum com { public
enum github { public enum jetbrains { public enum swiftexport { public enum packagea { } } } } } 30
Swift export ͷࢼ͠ํ Experimental // build.gradle.kts @OptIn(ExperimentalSwiftExportDsl::class) swiftExport { //
Root module name moduleName = "Shared" // Collapse rule flattenPackage = "com.github.jetbrains.swiftexport" } // Run Script Phase ./gradlew :shared:embedSwiftExportForXcode 31
Swift export ͷࢼ͠ํ Experimental https://github.com/Kotlin/swift-export-sample kotlin version Λ 2.2.20 ʹมߋ
32
·ͱΊ
·ͱΊ Swift ͔Β Kotlin Ͱॻ͔ΕͨॲཧΛݺͼग़͢ʹ Objective-C Λհ͢Δඞཁ͕͋Δ Objective-C export Objective-C
Λհ͞ͳ͍ Swift export ͕։ൃத Experimental Apple platform Ͱͷ KMP Λͬͨ։ൃऀମݧ্͕͢ΔݟࠐΈ 34