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
520
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
350
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
Python 3.14 Overview
lycorptech_jp
PRO
1
110
re:Invent 2025 ふりかえり 生成AI版
takaakikakei
1
210
Microsoft Agent 365 についてゆっくりじっくり理解する!
skmkzyk
0
330
品質のための共通認識
kakehashi
PRO
3
260
エンジニアとPMのドメイン知識の溝をなくす、 AIネイティブな開発プロセス
applism118
4
1.3k
文字列の並び順 / Unicode Collation
tmtms
3
590
AI 駆動開発勉強会 フロントエンド支部 #1 w/あずもば
1ftseabass
PRO
0
370
新 Security HubがついにGA!仕組みや料金を深堀り #AWSreInvent #regrowth / AWS Security Hub Advanced GA
masahirokawahara
1
2k
[デモです] NotebookLM で作ったスライドの例
kongmingstrap
0
150
AWS Trainium3 をちょっと身近に感じたい
bigmuramura
1
140
[JAWS-UG 横浜支部 #91]DevOps Agent vs CloudWatch Investigations -比較と実践-
sh_fk2
2
260
打 造 A I 驅 動 的 G i t H u b ⾃ 動 化 ⼯ 作 流 程
appleboy
0
330
Featured
See All Featured
Designing Experiences People Love
moore
143
24k
Six Lessons from altMBA
skipperchong
29
4.1k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
34k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.6k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.2k
Documentation Writing (for coders)
carmenintech
76
5.2k
Rails Girls Zürich Keynote
gr2m
95
14k
Scaling GitHub
holman
464
140k
Leading Effective Engineering Teams in the AI Era
addyosmani
8
1.3k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.8k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
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