Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
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
110
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
330
App内課金におけるトラブルを劇的に減らすための取り組み
kokihirokawa
2
1.2k
ABEMAのリアーキテクチャ
kokihirokawa
5
5.1k
Detect Body and Hand Pose with Vision
kokihirokawa
0
920
Other Decks in Technology
See All in Technology
今改めてServiceクラスについて考える 〜あるRails開発者の10年〜
joker1007
20
8.9k
WebアプリケーションのUI構築で気を付けてるポイント
tomokusaba
0
160
PyCon JP 2025 DAY1 「Hello, satellite data! ~Pythonではじめる衛星データ解析~」
ra0kley
0
730
SoccerNet GSRの紹介と技術応用:選手視点映像を提供するサッカー作戦盤ツール
mixi_engineers
PRO
1
100
AWSのProductのLifecycleについて
stknohg
PRO
0
290
PLaMo2シリーズのvLLM実装 / PFN LLM セミナー
pfn
PRO
2
730
AI Agentと MCP Serverで実現する iOSアプリの 自動テスト作成の効率化
spiderplus_cb
0
270
全てGoで作るP2P対戦ゲーム入門
ponyo877
3
1.2k
"複雑なデータ処理 × 静的サイト" を両立させる、楽をするRails運用 / A low-effort Rails workflow that combines “Complex Data Processing × Static Sites”
hogelog
3
1.3k
#普通の文系サラリーマンチャレンジ 自分でアプリ開発と電子工作を続けたら人生が変わった
tatsuya1970
0
750
“2件同時配達”の開発舞台裏 〜出前館PMが挑んだダブルピック実現に向けた体験設計〜
demaecan
0
160
業務自動化プラットフォーム Google Agentspace に入門してみる #devio2025
maroon1st
0
170
Featured
See All Featured
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
7
880
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
667
120k
Building Adaptive Systems
keathley
43
2.8k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
285
14k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
140
34k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
8
560
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
132
19k
Being A Developer After 40
akosma
90
590k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.4k
Scaling GitHub
holman
463
140k
Product Roadmaps are Hard
iamctodd
PRO
54
11k
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