SlideShare a Scribd company logo
1 of 98
Download to read offline
TOKYO IOS MEETUP | FEB 15 2023
WHY I
KOTLIN MULTIPLATFORM
DEREK LEE _ @DEREKLEEROCK
1
WHY I WANT
YOU
TO ALSO
❤
KOTLIN MULTIPLATFORM
2
!
HELLO, I'M DEREK!
> Full Stack / XP Software Engineer
> Previously @ Pivotal Labs (VMware
Tanzu Labs)
> 10+ Years iOS Dev
> 20+ Years IT/Software Engineering
"
> 30+ Years Drumming
> Drumming Education Side Projects →
Now full time!
3
TODAY WE'RE GOING TO TALK ABOUT...
> Why KMM?
> Trade Offs (Pros/Cons)
> Practical Use Cases
> Typical Dev Cycle, Ways of Sharing Code
> Important Multiplatform Skills
> Summary / Q&A / Feedback
4
SURVEY RESULTS: KMM EXPERIENCE
5
SURVEY RESULTS: MOST POPULAR TOPICS
6
IT ALL STARTED
WITH...
7
8
Check out the original presentation on this app on the
Tokyo iOS Meetup Youtube Channel:
DEREK LEE - INTRODUCING GAPCLICK - DECEMBER 8, 2018
!
https://youtu.be/z-3UdT7ye78
9
← MR. BENNY GREB
(WELL-KNOWN GERMAN DRUMMING
PHENOM AND EDUCATOR)
10
ME →
(UNKNOWN AMERICAN ASPIRING DRUMMER
AND INDISPUTABLY TYPE-A SOFTWARE
ENGINEER)
ASKS DEREK:
"What platforms should we build the
app for? Do you know what kind of
device the majority of your users
have?""
11
ANSWERS BENNY:
"I have an iPhone, so let's just build
this for the iPhone!"
!
(I AM OF COURSE PARAPHRASING AND
EXAGGERATING FOR THE SAKE OF HUMOR
GIVEN THAT I'M PRESENTING TO AN AUDIENCE
OF IOS ENGINEERS AND CONSIDERING THE
SLIDES THAT FOLLOW....)
12
FAST-FORWARD TO GAP
CLICK RELEASE
JUNE 2020...
13
!
https://www.youtube.com/watch?v=RCa7lebwhMc
14
SO HOW DID
PEOPLE REACT?
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Complimentary yet direct.
31
Stealth request wrapped in compliments.
32
Passive aggression.
33
Hey now, this is a family show.
34
Wow.
35
ROUGH TIMELINE
> Jan 2019: Research & incorporate KMM
(Swift → Kotlin Migration)
> June 2020: iOS Version Released!
(Already using KMM)
> February 2021: Android Version Released!
(about 8 months very much part-time work)
36
TO BUILD THE ANDROID APP USING KMM:
> UI (including phone + tablet layouts)
> Low-level audio (C++)
> Minimal Android Platform-Specific Code
(Preferences aka User Defaults)
> More Swift → Kotlin Migration
(MVC to MVP Presentation Layer)
37
GAP CLICK
ANDROID
RELEASE WAS....
38
!
SUCCESS!
39
CURRENT PROJECT: BEAT NOTE
!
https://beat-note.app/
40
BEAT NOTE DEMO
!
Dropbox Link
41
BEAT NOTE: BUILT W/KMM FROM THE START
> April 2021: Development Begins
> June 2022: MVP v1.0 Released
> January 2023: v2.0 Released
> Android Target: Spring/Summer 2023
> Web Target: Fall/Winter 2023
42
WHY CONSIDER MULTIPLATFORM?
1. Platform Expansion: iOS (1.8B1
), Android (2.5B2
), web (4.9B3
)
(# of devices)
2. Maximize shared code & minimize maintenance for
multiple platforms for business logic
3
https://www.zippia.com/advice/how-many-people-use-the-internet
2
https://www.businessofapps.com/data/android-statistics/
1
https://www.macrumors.com/2022/01/27/apple-1-8-billion-active-devices-worldwide
43
WHY KOTLIN MULTIPLATFORM?
In addition to the above..
BUILD NATIVE APPS WITH NATIVE UX
AND FULL NATIVE API ACCESS
44
WHY NOT USE X?
FIRST AND FOREMOST: NOTHING ELSE PROVIDES A NATIVE UX
> Ionic/Cordova/PhoneGap/etc: Javascript
> React Native: JavaScript + React
> Flutter: Dart
"
+ Unsupported by
(FLUTTER KIND OF HAS A NATIVE UX... BUT NOT REALLY )
45
KMM PROS: PRODUCT
> Platform expansion (Android, Web, others)
> Access to native UI (Swift UI, UIKit, future?)
> Access to native APIs (limited via Kotlin; all via Swift)
> Possible to adopt incrementally
> Increased product stability through:
> Shared code; fix bugs once; improve maintainability
46
KMM PROS: DEVELOPER EXPERIENCE
> Android Studio > Xcode
> Kotlin is similar to Swift, making it easy to learn
> Kotlin is a modern language; supported by JetBrains
> Kotlin is an official development language for Android
47
PRIMARY KMM
TRADEOFFS
48
KMM TRADEOFFS: ADDED BUILD PROCESS
COMPLEXITY
> Learn Kotlin DSL (or Gradle Groovy)
> Most of the time: once it's configured, there's rarely a
need to change
49
KMM TRADEOFFS: LONGER TIME TO BUILD
IOS PROJECT
> Buy an Mx Mac.
(You know you're just looking for an excuse anyway )
> Sometimes doesn't apply; depends on the task (more on
this later)
50
KMM TRADEOFFS: KOTLIN ↔ SWIFT/
OBJECTIVE-C LIMITATIONS
> Most applicable during migrations and learning KMM.
> Learn the necessary data transformations and
limitations.
> The more you maximize shared code, you minimize
integration points.
> Memory management constraints have improved
dramatically.
51
KMM TRADEOFFS: KOTLIN ↔ SWIFT/
OBJECTIVE-C LIMITATIONS
Your best resource for this is:
!
Interoperability with Swift/Objective-C
52
KMM TRADEOFFS: STILL EVOLVING
> Getting more stable: has recently entered beta
> Expect the tech to continue to further stabilize as
they move out of beta
53
KMM TRADEOFFS: NOT YET MAINSTREAM
> First-class support from JetBrains
> Please proactively contribute to this growing
community!
54
COMMON DEVELOPMENT CONCERNS
> Performance
> Build complexity
> Process complexity
> Team/engineer adoption hesitancy
> Risk of siloed skills
55
PRACTICAL USE CASES
1. Setting up a project from scratch
2. Swift → Kotlin Migration
3. Building a new feature in iOS
56
#1. SETTING UP A PROJECT FROM SCRATCH
> Would likely require it's own talk...
57
#1. SETTING UP A PROJECT FROM SCRATCH
> Try the Kotlin Multiplatform Plugin in Android Studio
58
#1. SETTING UP A PROJECT FROM SCRATCH
See also JetBrains Blog and YouTube channel for
resources and documentation:
!
Getting started and tutorials
!
Multiplatform Documentation
!
https://www.youtube.com/user/jetbrainstv
59
#1. SETTING UP A PROJECT FROM SCRATCH
Sample build.gradle.kts (Kotlin DSL)
plugins {
id("com.android.library")
kotlin("multiplatform")
}
kotlin {
android()
iosTarget()
...
}
val packForXcode by tasks.creating(Sync::class) {
...
}
60
#2. SWIFT → KOTLIN MIGRATION
> Start simple with domain model objects
> Start with a simple algorithm: Tap to set tempo
> Progress to more and more complex code paths
> Possible to move networking, local persistence, even
graphics rendering in shared code (!)
61
#2. SWIFT → KOTLIN MIGRATION
TAKE AN EXISTING ENUM IN SWIFT...
enum NoteValue: String, Codable {
case quarterNote
case eighthNote
var displayValue: String {
get {
switch self {
case .quarterNote: return "4"
case .eighthNote: return "8"
}
}
}
}
62
#2. SWIFT → KOTLIN MIGRATION
... AND MOVE IT OVER TO KOTLIN.
enum class NoteValue(val value: String) {
QuarterNote("QuarterNote"),
EighthNote("EighthNote");
val rawValue: String
get() = this.value
val displayValue: String
get() {
return when (this) {
QuarterNote -> "4"
EighthNote -> "8"
}
}
}
63
#2. SWIFT → KOTLIN MIGRATION
CHECK OUT THE OBJECTIVE-C CODE THAT GETS GENERATED:
__attribute__((objc_subclassing_restricted))
__attribute__((swift_name("NoteValue")))
@interface GCFNoteValue : GCFKotlinEnum<GCFNoteValue *>
+ (instancetype)alloc __attribute__((unavailable));
+ (instancetype)allocWithZone:(struct _NSZone *)zone __attribute__((unavailable));
- (instancetype)initWithName:(NSString *)name ordinal:(int32_t)ordinal
__attribute__((swift_name("init(name:ordinal:)")))
__attribute__((objc_designated_initializer)) __attribute__((unavailable));
@property (class, readonly) GCFNoteValue *quarternote __attribute__((swift_name("quarternote")));
@property (class, readonly) GCFNoteValue *eighthnote __attribute__((swift_name("eighthnote")));
+ (GCFKotlinArray<GCFNoteValue *> *)values __attribute__((swift_name("values()")));
@property (readonly) NSString *displayValue __attribute__((swift_name("displayValue")));
@property (readonly) NSString *rawValue __attribute__((swift_name("rawValue")));
@property (readonly) NSString *value __attribute__((swift_name("value")));
@end;
64
#2. SWIFT → KOTLIN MIGRATION
INTEGRATING CHANGES BETWEEN KOTLIN + SWIFT
> Re-builds XCFramework each time the Kotlin code
changes
> Common when migrating an existing app when learning
the integration points
VERDICT: TAKES SOME TIME
65
#3. BUILDING A NEW FEATURE IN IOS
SELECTING BEAT TAGS ON THE "MANAGE TAGS" SCREEN
66
#3. BUILDING A NEW FEATURE IN IOS
STEP #1: BUILD THE UI USING SWIFT
final class TagCollectionViewCell: AutoLayoutUICollectionViewCell {
func configure(tag: SelectableTag) {
nameLabel.text = tag.name
}
override var isSelected: Bool {
didSet {
let style: UILabelStyle = isSelected ? .tagNameSelected : .tagNameUnselected
nameLabel.applyStyle(style)
}
}
}
67
#3. BUILDING A NEW FEATURE IN IOS
STEP #1: BUILD THE UI USING SWIFT
> Builds shared (Kotlin) XCFramework once
> Performs incremental Xcode builds
> Write your code in Swift UI or UIKit
VERDICT: FAST!
68
#3. BUILDING A NEW FEATURE IN IOS
STEP #2: TDD BUSINESS LOGIC ENTIRELY IN KOTLIN
@Test
fun `gives list of multiple tags with one selected in beat cache`() {
spyStubBeatsCache.getBeat_returnValue = cacheBeatBuilder.withTags(setOf("rock")).build()
spyStubTagsRepository.allTags_returnValue = setOf(Tag("latin"), Tag("rock"))
val tags = presenter.tags
assertEquals("latin", tags[0].name)
assertEquals(false, tags[0].isSelected)
assertEquals("rock", tags[1].name)
assertEquals(true, tags[1].isSelected)
}
69
#3. BUILDING A NEW FEATURE IN IOS
STEP #2: TDD BUSINESS LOGIC ENTIRELY IN KOTLIN
class ManageTagsPresenter(...) : ManageTagsContract.Presenter {
override val tags: List<SelectableTag>
get() {
val beatTags = beatDataMediation.beat.tags
return tagsRepository.allTags.map { tag ->
val isTagSelectedForBeat = beatTags.contains(tag.name)
return@map SelectableTag(tag.name, isTagSelectedForBeat)
}
}
}
70
#3. BUILDING A NEW FEATURE IN IOS
STEP #2: TDD BUSINESS LOGIC ENTIRELY IN KOTLIN
35ms to run these three tests!
71
#3. BUILDING A NEW FEATURE IN IOS
STEP #2: TDD BUSINESS LOGIC ENTIRELY IN KOTLIN
> Does not require XC Framework to be built
> Super fast tests and compilation
> Quick TDD cycles (red - green - refactor)
VERDICT: FAST!
72
"But Derek, that was only three
tests!"
73
376 TESTS → 674MS
74
SO WHAT DOES THE BUILD
PERFORMANCE LOOK LIKE?
75
PERFORMANCE: BUILDING THE
XCFRAMEWORK
(2021 M1 MAX MACBOOK PRO | 64GB RAM)
Module Files Lines of Code Scratch Build Re-Build
GapClick Shared 62 2057 ~4-5sec ~1-2sec
Drum Notation 32 1082 ~10sec ~1-2sec
Beat Note Shared 328 15528 ~30sec ~1-2sec
76
WAYS OF SHARING CODE
> expect/actual
> Kotlin interface + Swift Implementation
> Kotlin Abstract Class + Swift Implementation
> 100% Kotlin (shared)
77
WAYS OF SHARING CODE
See by blog post series on this for more details and code
samples:
!
The iOS Engineer’s Guide to Beginning Kotlin
Multiplatform Development
78
IMPORTANT SKILLS FOR MULTIPLATFORM
DEVELOPMENT
> Identifying dependencies in code (3rd party and
platform)
> Dependency Injection
> SOLID: Single Responsibility
> SOLID: Dependency Inversion
79
JUST HOW MUCH CODE CAN BE SHARED?
This depends on how creative you are, and...
How clearly you can identify platform-specific
dependencies and isolate them in your code.
80
GAP CLICK CODE BREAKDOWN (GITHUB)
But this is misleading... there are a lot of tests in Swift.
81
GAP CLICK CODE BREAKDOWN (IOS)
Module Files Lines of Code % Breakdown
iOS App (Swift) 123 7239 78%
KMM Shared
(Kotlin)
62 2057 22%
82
GAP CLICK CODE BREAKDOWN (ANDROID)
Module Files Lines of Code % Breakdown
Android App (Kotlin) 30 1624 22%
Android App (C++) 20 1136 16%
Android App (XML) 51 2449 34%
KMM Shared (Kotlin) 62 2057 28%
83
GAP CLICK CODE BREAKDOWN (TESTS)
Module Files Lines of Code
iOS Tests (Swift) 120 7098
----- --- ----
Android Tests (Kotlin) 13 479
Android Tests (C++) 7 1739
84
BEAT NOTE CODE BREAKDOWN
(* Monorepo includes server + clients)
85
BEAT NOTE CODE BREAKDOWN (IOS)
Module Files Lines of Code % Breakdown
iOS App (Swift) 217 16027 44½%
KMM Shared (Kotlin) 333 15605 43½%
Music Notation (Obj-C) 79 3177 9%
Drum Notation Shared
(Kotlin)
34 1108 3%
86
BEAT NOTE CODE BREAKDOWN (ANDROID)
TBD...
87
Gap Click -vs- Beat Note Code Stats
88
SUMMARY
> KMM allows you to share common logic using Kotlin
> Additional platforms can expand your reach
> KMM can be adopted incrementally
> There are several different ways to share code
> KMM is in beta and the community is growing
89
PLEASE SHARE YOUR FEEDBACK!
!
HTTPS://FORMS.GLE/DKRDEQXM7SBXOAP99
THANK YOU!
!
@DEREKLEEROCK [ALL SOCIALS]
90
ADDITIONAL SLIDES FOR REFERENCE
I WON'T COVER THESE IN THE
PRESENTATION, BUT YOU MIGHT FIND
THE INFORMATION HELPFUL.
91
DEVELOPMENT ENVIRONMENT
> Xcode/SPM
> Android Studio/Gradle/Java
> 3rd Party Dependencies and Plugins as needed
92
POPULAR 3RD PARTY LIBRARIES
> Ktor: Multiplatform Networking (client and server)
https://github.com/ktorio/ktor
> kotlinx-serialization: Multiplatform Serialization
https://github.com/Kotlin/kotlinx.serialization
> kotlinx-datetime: Multiplatform Date/Time
https://github.com/Kotlin/kotlinx-datetime
93
POPULAR 3RD PARTY LIBRARIES
> Multiplatform-Settings: UserDefaults/Preferences
https://github.com/russhwolf/multiplatform-settings
> SQLDelight: Multiplatform SQLite Typesafe APIs
https://github.com/cashapp/sqldelight
> Kotlin Multiplatform Libraries Collection
https://github.com/AAkira/Kotlin-Multiplatform-
Libraries
94
CODE SHARING: EXPECT/ACTUAL
> Writing both Android and iOS code using Kotlin
> Limited to Objective-C APIs (no Swift APIs!)
> Sometimes frustrating how to write iOS code
> I recommended using this only for building libraries
> Others recommend this for Android developers
95
CODE SHARING: KOTLIN INTERFACE + SWIFT
IMPLEMENTATION
> Ideal for objects that heavily rely on platform specific
APIs
> Recommended for iOS engineers over expect/actual
> Write an interface in Kotlin
> Implement the interface in Android as you would
96
ABSTRACT CLASS + SWIFT IMPLEMENTATION
> Similar to the previous, only the abstract Kotlin class
can contain shared logic
> Use abstract methods for implementing platform-
specific details
> Similar to the Template Object-Oriented Design Pattern
97
100% KOTLIN (SHARED)
> Write all of your code in Kotlin!
> Inject platform-specific dependencies as needed
98

More Related Content

What's hot

[MeetUp][1st] 오리뎅이의_쿠버네티스_네트워킹
[MeetUp][1st] 오리뎅이의_쿠버네티스_네트워킹[MeetUp][1st] 오리뎅이의_쿠버네티스_네트워킹
[MeetUp][1st] 오리뎅이의_쿠버네티스_네트워킹InfraEngineer
 
Transaction Management on Cassandra
Transaction Management on CassandraTransaction Management on Cassandra
Transaction Management on CassandraScalar, Inc.
 
SpringBoot 3 Observability
SpringBoot 3 ObservabilitySpringBoot 3 Observability
SpringBoot 3 ObservabilityKnoldus Inc.
 
Qt Design Patterns
Qt Design PatternsQt Design Patterns
Qt Design PatternsYnon Perek
 
[MOPCON 2022] 以 Kotlin Multiplatform 制霸全平台
[MOPCON 2022] 以 Kotlin Multiplatform 制霸全平台[MOPCON 2022] 以 Kotlin Multiplatform 制霸全平台
[MOPCON 2022] 以 Kotlin Multiplatform 制霸全平台Shengyou Fan
 
Introduction to kotlin and OOP in Kotlin
Introduction to kotlin and OOP in KotlinIntroduction to kotlin and OOP in Kotlin
Introduction to kotlin and OOP in Kotlinvriddhigupta
 
Android Development with Kotlin course
Android Development  with Kotlin courseAndroid Development  with Kotlin course
Android Development with Kotlin courseGoogleDevelopersLeba
 
In-depth analysis of Kotlin Flows
In-depth analysis of Kotlin FlowsIn-depth analysis of Kotlin Flows
In-depth analysis of Kotlin FlowsGlobalLogic Ukraine
 
Discover Quarkus and GraalVM
Discover Quarkus and GraalVMDiscover Quarkus and GraalVM
Discover Quarkus and GraalVMRomain Schlick
 
Threading Made Easy! A Busy Developer’s Guide to Kotlin Coroutines
Threading Made Easy! A Busy Developer’s Guide to Kotlin CoroutinesThreading Made Easy! A Busy Developer’s Guide to Kotlin Coroutines
Threading Made Easy! A Busy Developer’s Guide to Kotlin CoroutinesLauren Yew
 
Using Queryable State for Fun and Profit
Using Queryable State for Fun and ProfitUsing Queryable State for Fun and Profit
Using Queryable State for Fun and ProfitFlink Forward
 
Battle Of The Microservice Frameworks: Micronaut versus Quarkus edition!
Battle Of The Microservice Frameworks: Micronaut versus Quarkus edition! Battle Of The Microservice Frameworks: Micronaut versus Quarkus edition!
Battle Of The Microservice Frameworks: Micronaut versus Quarkus edition! Michel Schudel
 
Gradle - the Enterprise Automation Tool
Gradle  - the Enterprise Automation ToolGradle  - the Enterprise Automation Tool
Gradle - the Enterprise Automation ToolIzzet Mustafaiev
 
The Kotlin Programming Language
The Kotlin Programming LanguageThe Kotlin Programming Language
The Kotlin Programming Languageintelliyole
 
Tuning Apache Kafka Connectors for Flink.pptx
Tuning Apache Kafka Connectors for Flink.pptxTuning Apache Kafka Connectors for Flink.pptx
Tuning Apache Kafka Connectors for Flink.pptxFlink Forward
 
Android kotlin coroutines
Android kotlin coroutinesAndroid kotlin coroutines
Android kotlin coroutinesBipin Vayalu
 
An introduction to JVM performance
An introduction to JVM performanceAn introduction to JVM performance
An introduction to JVM performanceRafael Winterhalter
 
Jetpack Compose - A Lightning Tour
Jetpack Compose - A Lightning TourJetpack Compose - A Lightning Tour
Jetpack Compose - A Lightning TourMatthew Clarke
 
[JCConf 2023] 從 Kotlin Multiplatform 到 Compose Multiplatform:在多平台間輕鬆共用業務邏輯與 U...
[JCConf 2023] 從 Kotlin Multiplatform 到 Compose Multiplatform:在多平台間輕鬆共用業務邏輯與 U...[JCConf 2023] 從 Kotlin Multiplatform 到 Compose Multiplatform:在多平台間輕鬆共用業務邏輯與 U...
[JCConf 2023] 從 Kotlin Multiplatform 到 Compose Multiplatform:在多平台間輕鬆共用業務邏輯與 U...Shengyou Fan
 

What's hot (20)

[MeetUp][1st] 오리뎅이의_쿠버네티스_네트워킹
[MeetUp][1st] 오리뎅이의_쿠버네티스_네트워킹[MeetUp][1st] 오리뎅이의_쿠버네티스_네트워킹
[MeetUp][1st] 오리뎅이의_쿠버네티스_네트워킹
 
Transaction Management on Cassandra
Transaction Management on CassandraTransaction Management on Cassandra
Transaction Management on Cassandra
 
SpringBoot 3 Observability
SpringBoot 3 ObservabilitySpringBoot 3 Observability
SpringBoot 3 Observability
 
Qt Design Patterns
Qt Design PatternsQt Design Patterns
Qt Design Patterns
 
[MOPCON 2022] 以 Kotlin Multiplatform 制霸全平台
[MOPCON 2022] 以 Kotlin Multiplatform 制霸全平台[MOPCON 2022] 以 Kotlin Multiplatform 制霸全平台
[MOPCON 2022] 以 Kotlin Multiplatform 制霸全平台
 
Introduction to kotlin and OOP in Kotlin
Introduction to kotlin and OOP in KotlinIntroduction to kotlin and OOP in Kotlin
Introduction to kotlin and OOP in Kotlin
 
Android Development with Kotlin course
Android Development  with Kotlin courseAndroid Development  with Kotlin course
Android Development with Kotlin course
 
In-depth analysis of Kotlin Flows
In-depth analysis of Kotlin FlowsIn-depth analysis of Kotlin Flows
In-depth analysis of Kotlin Flows
 
Discover Quarkus and GraalVM
Discover Quarkus and GraalVMDiscover Quarkus and GraalVM
Discover Quarkus and GraalVM
 
Threading Made Easy! A Busy Developer’s Guide to Kotlin Coroutines
Threading Made Easy! A Busy Developer’s Guide to Kotlin CoroutinesThreading Made Easy! A Busy Developer’s Guide to Kotlin Coroutines
Threading Made Easy! A Busy Developer’s Guide to Kotlin Coroutines
 
Using Queryable State for Fun and Profit
Using Queryable State for Fun and ProfitUsing Queryable State for Fun and Profit
Using Queryable State for Fun and Profit
 
Battle Of The Microservice Frameworks: Micronaut versus Quarkus edition!
Battle Of The Microservice Frameworks: Micronaut versus Quarkus edition! Battle Of The Microservice Frameworks: Micronaut versus Quarkus edition!
Battle Of The Microservice Frameworks: Micronaut versus Quarkus edition!
 
Gradle - the Enterprise Automation Tool
Gradle  - the Enterprise Automation ToolGradle  - the Enterprise Automation Tool
Gradle - the Enterprise Automation Tool
 
The Kotlin Programming Language
The Kotlin Programming LanguageThe Kotlin Programming Language
The Kotlin Programming Language
 
Tuning Apache Kafka Connectors for Flink.pptx
Tuning Apache Kafka Connectors for Flink.pptxTuning Apache Kafka Connectors for Flink.pptx
Tuning Apache Kafka Connectors for Flink.pptx
 
Android kotlin coroutines
Android kotlin coroutinesAndroid kotlin coroutines
Android kotlin coroutines
 
Intro to kotlin
Intro to kotlinIntro to kotlin
Intro to kotlin
 
An introduction to JVM performance
An introduction to JVM performanceAn introduction to JVM performance
An introduction to JVM performance
 
Jetpack Compose - A Lightning Tour
Jetpack Compose - A Lightning TourJetpack Compose - A Lightning Tour
Jetpack Compose - A Lightning Tour
 
[JCConf 2023] 從 Kotlin Multiplatform 到 Compose Multiplatform:在多平台間輕鬆共用業務邏輯與 U...
[JCConf 2023] 從 Kotlin Multiplatform 到 Compose Multiplatform:在多平台間輕鬆共用業務邏輯與 U...[JCConf 2023] 從 Kotlin Multiplatform 到 Compose Multiplatform:在多平台間輕鬆共用業務邏輯與 U...
[JCConf 2023] 從 Kotlin Multiplatform 到 Compose Multiplatform:在多平台間輕鬆共用業務邏輯與 U...
 

Similar to Why I ❤️ Kotlin Multiplatform (and want YOU to also ❤️ Kotlin Multiplatform)

Multiplatform shared codebase with Kotlin/Native - UA Mobile 2019
Multiplatform shared codebase with Kotlin/Native - UA Mobile 2019Multiplatform shared codebase with Kotlin/Native - UA Mobile 2019
Multiplatform shared codebase with Kotlin/Native - UA Mobile 2019UA Mobile
 
Multiplatform shared codebase with Kotlin/Native - UA Mobile 2019
Multiplatform shared codebase with Kotlin/Native - UA Mobile 2019Multiplatform shared codebase with Kotlin/Native - UA Mobile 2019
Multiplatform shared codebase with Kotlin/Native - UA Mobile 2019Eugene Kurko
 
Tell Me Quando - Implementing Feature Flags
Tell Me Quando - Implementing Feature FlagsTell Me Quando - Implementing Feature Flags
Tell Me Quando - Implementing Feature FlagsJorge Ortiz
 
Kotlin Multiplatform in Action - Alexandr Pogrebnyak - IceRockDev
Kotlin Multiplatform in Action - Alexandr Pogrebnyak - IceRockDevKotlin Multiplatform in Action - Alexandr Pogrebnyak - IceRockDev
Kotlin Multiplatform in Action - Alexandr Pogrebnyak - IceRockDevDroidConTLV
 
State ofappdevelopment
State ofappdevelopmentState ofappdevelopment
State ofappdevelopmentgillygize
 
Cross-Platform Mobile Development in Visual Studio
Cross-Platform Mobile Development in Visual StudioCross-Platform Mobile Development in Visual Studio
Cross-Platform Mobile Development in Visual Studiobryan costanich
 
Hacking the Kinect with GAFFTA Day 1
Hacking the Kinect with GAFFTA Day 1Hacking the Kinect with GAFFTA Day 1
Hacking the Kinect with GAFFTA Day 1benDesigning
 
Introduction to MonoTouch
Introduction to MonoTouchIntroduction to MonoTouch
Introduction to MonoTouchJonas Follesø
 
CampJS - Making gaming more fun and efficient
CampJS - Making gaming more fun and efficientCampJS - Making gaming more fun and efficient
CampJS - Making gaming more fun and efficientCong Nguyen
 
Developing iOS apps on your iPad with XCAB
Developing iOS apps on your iPad with XCABDeveloping iOS apps on your iPad with XCAB
Developing iOS apps on your iPad with XCABCarl Brown
 
2013-03-07 indie developer toolkit
2013-03-07 indie developer toolkit2013-03-07 indie developer toolkit
2013-03-07 indie developer toolkitCocoaHeads Tricity
 
Eclipse IDE and Platform news on Fosdem 2020
Eclipse IDE and Platform news on Fosdem 2020Eclipse IDE and Platform news on Fosdem 2020
Eclipse IDE and Platform news on Fosdem 2020Lars Vogel
 
Effective Kubernetes - Is Kubernetes the new Linux? Is the new Application Se...
Effective Kubernetes - Is Kubernetes the new Linux? Is the new Application Se...Effective Kubernetes - Is Kubernetes the new Linux? Is the new Application Se...
Effective Kubernetes - Is Kubernetes the new Linux? Is the new Application Se...Wojciech Barczyński
 
Open frameworks 101_fitc
Open frameworks 101_fitcOpen frameworks 101_fitc
Open frameworks 101_fitcbenDesigning
 
Import golang; struct microservice
Import golang; struct microserviceImport golang; struct microservice
Import golang; struct microserviceGiulio De Donato
 
Extending Appcelerator Titanium Mobile through Native Modules
Extending Appcelerator Titanium Mobile through Native ModulesExtending Appcelerator Titanium Mobile through Native Modules
Extending Appcelerator Titanium Mobile through Native Modulesomorandi
 
DockerCon 15 Keynote - Day 2
DockerCon 15 Keynote - Day 2DockerCon 15 Keynote - Day 2
DockerCon 15 Keynote - Day 2Docker, Inc.
 
cbmanual
cbmanualcbmanual
cbmanualMatt D
 
Mac ruby deployment
Mac ruby deploymentMac ruby deployment
Mac ruby deploymentThilo Utke
 

Similar to Why I ❤️ Kotlin Multiplatform (and want YOU to also ❤️ Kotlin Multiplatform) (20)

Multiplatform shared codebase with Kotlin/Native - UA Mobile 2019
Multiplatform shared codebase with Kotlin/Native - UA Mobile 2019Multiplatform shared codebase with Kotlin/Native - UA Mobile 2019
Multiplatform shared codebase with Kotlin/Native - UA Mobile 2019
 
Multiplatform shared codebase with Kotlin/Native - UA Mobile 2019
Multiplatform shared codebase with Kotlin/Native - UA Mobile 2019Multiplatform shared codebase with Kotlin/Native - UA Mobile 2019
Multiplatform shared codebase with Kotlin/Native - UA Mobile 2019
 
20110709 - CM_Cocoa
20110709 - CM_Cocoa20110709 - CM_Cocoa
20110709 - CM_Cocoa
 
Tell Me Quando - Implementing Feature Flags
Tell Me Quando - Implementing Feature FlagsTell Me Quando - Implementing Feature Flags
Tell Me Quando - Implementing Feature Flags
 
Kotlin Multiplatform in Action - Alexandr Pogrebnyak - IceRockDev
Kotlin Multiplatform in Action - Alexandr Pogrebnyak - IceRockDevKotlin Multiplatform in Action - Alexandr Pogrebnyak - IceRockDev
Kotlin Multiplatform in Action - Alexandr Pogrebnyak - IceRockDev
 
State ofappdevelopment
State ofappdevelopmentState ofappdevelopment
State ofappdevelopment
 
Cross-Platform Mobile Development in Visual Studio
Cross-Platform Mobile Development in Visual StudioCross-Platform Mobile Development in Visual Studio
Cross-Platform Mobile Development in Visual Studio
 
Hacking the Kinect with GAFFTA Day 1
Hacking the Kinect with GAFFTA Day 1Hacking the Kinect with GAFFTA Day 1
Hacking the Kinect with GAFFTA Day 1
 
Introduction to MonoTouch
Introduction to MonoTouchIntroduction to MonoTouch
Introduction to MonoTouch
 
CampJS - Making gaming more fun and efficient
CampJS - Making gaming more fun and efficientCampJS - Making gaming more fun and efficient
CampJS - Making gaming more fun and efficient
 
Developing iOS apps on your iPad with XCAB
Developing iOS apps on your iPad with XCABDeveloping iOS apps on your iPad with XCAB
Developing iOS apps on your iPad with XCAB
 
2013-03-07 indie developer toolkit
2013-03-07 indie developer toolkit2013-03-07 indie developer toolkit
2013-03-07 indie developer toolkit
 
Eclipse IDE and Platform news on Fosdem 2020
Eclipse IDE and Platform news on Fosdem 2020Eclipse IDE and Platform news on Fosdem 2020
Eclipse IDE and Platform news on Fosdem 2020
 
Effective Kubernetes - Is Kubernetes the new Linux? Is the new Application Se...
Effective Kubernetes - Is Kubernetes the new Linux? Is the new Application Se...Effective Kubernetes - Is Kubernetes the new Linux? Is the new Application Se...
Effective Kubernetes - Is Kubernetes the new Linux? Is the new Application Se...
 
Open frameworks 101_fitc
Open frameworks 101_fitcOpen frameworks 101_fitc
Open frameworks 101_fitc
 
Import golang; struct microservice
Import golang; struct microserviceImport golang; struct microservice
Import golang; struct microservice
 
Extending Appcelerator Titanium Mobile through Native Modules
Extending Appcelerator Titanium Mobile through Native ModulesExtending Appcelerator Titanium Mobile through Native Modules
Extending Appcelerator Titanium Mobile through Native Modules
 
DockerCon 15 Keynote - Day 2
DockerCon 15 Keynote - Day 2DockerCon 15 Keynote - Day 2
DockerCon 15 Keynote - Day 2
 
cbmanual
cbmanualcbmanual
cbmanual
 
Mac ruby deployment
Mac ruby deploymentMac ruby deployment
Mac ruby deployment
 

More from Derek Lee Boire

Effective BDD Testing 効果的なBDDテスト [iOS]
Effective BDD Testing 効果的なBDDテスト [iOS]Effective BDD Testing 効果的なBDDテスト [iOS]
Effective BDD Testing 効果的なBDDテスト [iOS]Derek Lee Boire
 
Standing the Test of Time: The Date Provider Pattern
Standing the Test of Time: The Date Provider PatternStanding the Test of Time: The Date Provider Pattern
Standing the Test of Time: The Date Provider PatternDerek Lee Boire
 
Minimizing Decision Fatigue to Improve Team Productivity
Minimizing Decision Fatigue to Improve Team ProductivityMinimizing Decision Fatigue to Improve Team Productivity
Minimizing Decision Fatigue to Improve Team ProductivityDerek Lee Boire
 
Writing Clean Code in Swift
Writing Clean Code in SwiftWriting Clean Code in Swift
Writing Clean Code in SwiftDerek Lee Boire
 
Common Challenges & Best Practices for TDD on iOS
Common Challenges & Best Practices for TDD on iOSCommon Challenges & Best Practices for TDD on iOS
Common Challenges & Best Practices for TDD on iOSDerek Lee Boire
 
Adjusting to Auto Layout (Tutorial / Tips for iOS Auto Layout)
Adjusting to Auto Layout (Tutorial / Tips for iOS Auto Layout)Adjusting to Auto Layout (Tutorial / Tips for iOS Auto Layout)
Adjusting to Auto Layout (Tutorial / Tips for iOS Auto Layout)Derek Lee Boire
 

More from Derek Lee Boire (6)

Effective BDD Testing 効果的なBDDテスト [iOS]
Effective BDD Testing 効果的なBDDテスト [iOS]Effective BDD Testing 効果的なBDDテスト [iOS]
Effective BDD Testing 効果的なBDDテスト [iOS]
 
Standing the Test of Time: The Date Provider Pattern
Standing the Test of Time: The Date Provider PatternStanding the Test of Time: The Date Provider Pattern
Standing the Test of Time: The Date Provider Pattern
 
Minimizing Decision Fatigue to Improve Team Productivity
Minimizing Decision Fatigue to Improve Team ProductivityMinimizing Decision Fatigue to Improve Team Productivity
Minimizing Decision Fatigue to Improve Team Productivity
 
Writing Clean Code in Swift
Writing Clean Code in SwiftWriting Clean Code in Swift
Writing Clean Code in Swift
 
Common Challenges & Best Practices for TDD on iOS
Common Challenges & Best Practices for TDD on iOSCommon Challenges & Best Practices for TDD on iOS
Common Challenges & Best Practices for TDD on iOS
 
Adjusting to Auto Layout (Tutorial / Tips for iOS Auto Layout)
Adjusting to Auto Layout (Tutorial / Tips for iOS Auto Layout)Adjusting to Auto Layout (Tutorial / Tips for iOS Auto Layout)
Adjusting to Auto Layout (Tutorial / Tips for iOS Auto Layout)
 

Recently uploaded

Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Intelisync
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 

Recently uploaded (20)

Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 

Why I ❤️ Kotlin Multiplatform (and want YOU to also ❤️ Kotlin Multiplatform)

  • 1. TOKYO IOS MEETUP | FEB 15 2023 WHY I KOTLIN MULTIPLATFORM DEREK LEE _ @DEREKLEEROCK 1
  • 2. WHY I WANT YOU TO ALSO ❤ KOTLIN MULTIPLATFORM 2
  • 3. ! HELLO, I'M DEREK! > Full Stack / XP Software Engineer > Previously @ Pivotal Labs (VMware Tanzu Labs) > 10+ Years iOS Dev > 20+ Years IT/Software Engineering " > 30+ Years Drumming > Drumming Education Side Projects → Now full time! 3
  • 4. TODAY WE'RE GOING TO TALK ABOUT... > Why KMM? > Trade Offs (Pros/Cons) > Practical Use Cases > Typical Dev Cycle, Ways of Sharing Code > Important Multiplatform Skills > Summary / Q&A / Feedback 4
  • 5. SURVEY RESULTS: KMM EXPERIENCE 5
  • 6. SURVEY RESULTS: MOST POPULAR TOPICS 6
  • 8. 8
  • 9. Check out the original presentation on this app on the Tokyo iOS Meetup Youtube Channel: DEREK LEE - INTRODUCING GAPCLICK - DECEMBER 8, 2018 ! https://youtu.be/z-3UdT7ye78 9
  • 10. ← MR. BENNY GREB (WELL-KNOWN GERMAN DRUMMING PHENOM AND EDUCATOR) 10
  • 11. ME → (UNKNOWN AMERICAN ASPIRING DRUMMER AND INDISPUTABLY TYPE-A SOFTWARE ENGINEER) ASKS DEREK: "What platforms should we build the app for? Do you know what kind of device the majority of your users have?"" 11
  • 12. ANSWERS BENNY: "I have an iPhone, so let's just build this for the iPhone!" ! (I AM OF COURSE PARAPHRASING AND EXAGGERATING FOR THE SAKE OF HUMOR GIVEN THAT I'M PRESENTING TO AN AUDIENCE OF IOS ENGINEERS AND CONSIDERING THE SLIDES THAT FOLLOW....) 12
  • 13. FAST-FORWARD TO GAP CLICK RELEASE JUNE 2020... 13
  • 15. SO HOW DID PEOPLE REACT? 15
  • 16. 16
  • 17. 17
  • 18. 18
  • 19. 19
  • 20. 20
  • 21. 21
  • 22. 22
  • 23. 23
  • 24. 24
  • 25. 25
  • 26. 26
  • 27. 27
  • 28. 28
  • 29. 29
  • 30. 30
  • 32. Stealth request wrapped in compliments. 32
  • 34. Hey now, this is a family show. 34
  • 36. ROUGH TIMELINE > Jan 2019: Research & incorporate KMM (Swift → Kotlin Migration) > June 2020: iOS Version Released! (Already using KMM) > February 2021: Android Version Released! (about 8 months very much part-time work) 36
  • 37. TO BUILD THE ANDROID APP USING KMM: > UI (including phone + tablet layouts) > Low-level audio (C++) > Minimal Android Platform-Specific Code (Preferences aka User Defaults) > More Swift → Kotlin Migration (MVC to MVP Presentation Layer) 37
  • 40. CURRENT PROJECT: BEAT NOTE ! https://beat-note.app/ 40
  • 42. BEAT NOTE: BUILT W/KMM FROM THE START > April 2021: Development Begins > June 2022: MVP v1.0 Released > January 2023: v2.0 Released > Android Target: Spring/Summer 2023 > Web Target: Fall/Winter 2023 42
  • 43. WHY CONSIDER MULTIPLATFORM? 1. Platform Expansion: iOS (1.8B1 ), Android (2.5B2 ), web (4.9B3 ) (# of devices) 2. Maximize shared code & minimize maintenance for multiple platforms for business logic 3 https://www.zippia.com/advice/how-many-people-use-the-internet 2 https://www.businessofapps.com/data/android-statistics/ 1 https://www.macrumors.com/2022/01/27/apple-1-8-billion-active-devices-worldwide 43
  • 44. WHY KOTLIN MULTIPLATFORM? In addition to the above.. BUILD NATIVE APPS WITH NATIVE UX AND FULL NATIVE API ACCESS 44
  • 45. WHY NOT USE X? FIRST AND FOREMOST: NOTHING ELSE PROVIDES A NATIVE UX > Ionic/Cordova/PhoneGap/etc: Javascript > React Native: JavaScript + React > Flutter: Dart " + Unsupported by (FLUTTER KIND OF HAS A NATIVE UX... BUT NOT REALLY ) 45
  • 46. KMM PROS: PRODUCT > Platform expansion (Android, Web, others) > Access to native UI (Swift UI, UIKit, future?) > Access to native APIs (limited via Kotlin; all via Swift) > Possible to adopt incrementally > Increased product stability through: > Shared code; fix bugs once; improve maintainability 46
  • 47. KMM PROS: DEVELOPER EXPERIENCE > Android Studio > Xcode > Kotlin is similar to Swift, making it easy to learn > Kotlin is a modern language; supported by JetBrains > Kotlin is an official development language for Android 47
  • 49. KMM TRADEOFFS: ADDED BUILD PROCESS COMPLEXITY > Learn Kotlin DSL (or Gradle Groovy) > Most of the time: once it's configured, there's rarely a need to change 49
  • 50. KMM TRADEOFFS: LONGER TIME TO BUILD IOS PROJECT > Buy an Mx Mac. (You know you're just looking for an excuse anyway ) > Sometimes doesn't apply; depends on the task (more on this later) 50
  • 51. KMM TRADEOFFS: KOTLIN ↔ SWIFT/ OBJECTIVE-C LIMITATIONS > Most applicable during migrations and learning KMM. > Learn the necessary data transformations and limitations. > The more you maximize shared code, you minimize integration points. > Memory management constraints have improved dramatically. 51
  • 52. KMM TRADEOFFS: KOTLIN ↔ SWIFT/ OBJECTIVE-C LIMITATIONS Your best resource for this is: ! Interoperability with Swift/Objective-C 52
  • 53. KMM TRADEOFFS: STILL EVOLVING > Getting more stable: has recently entered beta > Expect the tech to continue to further stabilize as they move out of beta 53
  • 54. KMM TRADEOFFS: NOT YET MAINSTREAM > First-class support from JetBrains > Please proactively contribute to this growing community! 54
  • 55. COMMON DEVELOPMENT CONCERNS > Performance > Build complexity > Process complexity > Team/engineer adoption hesitancy > Risk of siloed skills 55
  • 56. PRACTICAL USE CASES 1. Setting up a project from scratch 2. Swift → Kotlin Migration 3. Building a new feature in iOS 56
  • 57. #1. SETTING UP A PROJECT FROM SCRATCH > Would likely require it's own talk... 57
  • 58. #1. SETTING UP A PROJECT FROM SCRATCH > Try the Kotlin Multiplatform Plugin in Android Studio 58
  • 59. #1. SETTING UP A PROJECT FROM SCRATCH See also JetBrains Blog and YouTube channel for resources and documentation: ! Getting started and tutorials ! Multiplatform Documentation ! https://www.youtube.com/user/jetbrainstv 59
  • 60. #1. SETTING UP A PROJECT FROM SCRATCH Sample build.gradle.kts (Kotlin DSL) plugins { id("com.android.library") kotlin("multiplatform") } kotlin { android() iosTarget() ... } val packForXcode by tasks.creating(Sync::class) { ... } 60
  • 61. #2. SWIFT → KOTLIN MIGRATION > Start simple with domain model objects > Start with a simple algorithm: Tap to set tempo > Progress to more and more complex code paths > Possible to move networking, local persistence, even graphics rendering in shared code (!) 61
  • 62. #2. SWIFT → KOTLIN MIGRATION TAKE AN EXISTING ENUM IN SWIFT... enum NoteValue: String, Codable { case quarterNote case eighthNote var displayValue: String { get { switch self { case .quarterNote: return "4" case .eighthNote: return "8" } } } } 62
  • 63. #2. SWIFT → KOTLIN MIGRATION ... AND MOVE IT OVER TO KOTLIN. enum class NoteValue(val value: String) { QuarterNote("QuarterNote"), EighthNote("EighthNote"); val rawValue: String get() = this.value val displayValue: String get() { return when (this) { QuarterNote -> "4" EighthNote -> "8" } } } 63
  • 64. #2. SWIFT → KOTLIN MIGRATION CHECK OUT THE OBJECTIVE-C CODE THAT GETS GENERATED: __attribute__((objc_subclassing_restricted)) __attribute__((swift_name("NoteValue"))) @interface GCFNoteValue : GCFKotlinEnum<GCFNoteValue *> + (instancetype)alloc __attribute__((unavailable)); + (instancetype)allocWithZone:(struct _NSZone *)zone __attribute__((unavailable)); - (instancetype)initWithName:(NSString *)name ordinal:(int32_t)ordinal __attribute__((swift_name("init(name:ordinal:)"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable)); @property (class, readonly) GCFNoteValue *quarternote __attribute__((swift_name("quarternote"))); @property (class, readonly) GCFNoteValue *eighthnote __attribute__((swift_name("eighthnote"))); + (GCFKotlinArray<GCFNoteValue *> *)values __attribute__((swift_name("values()"))); @property (readonly) NSString *displayValue __attribute__((swift_name("displayValue"))); @property (readonly) NSString *rawValue __attribute__((swift_name("rawValue"))); @property (readonly) NSString *value __attribute__((swift_name("value"))); @end; 64
  • 65. #2. SWIFT → KOTLIN MIGRATION INTEGRATING CHANGES BETWEEN KOTLIN + SWIFT > Re-builds XCFramework each time the Kotlin code changes > Common when migrating an existing app when learning the integration points VERDICT: TAKES SOME TIME 65
  • 66. #3. BUILDING A NEW FEATURE IN IOS SELECTING BEAT TAGS ON THE "MANAGE TAGS" SCREEN 66
  • 67. #3. BUILDING A NEW FEATURE IN IOS STEP #1: BUILD THE UI USING SWIFT final class TagCollectionViewCell: AutoLayoutUICollectionViewCell { func configure(tag: SelectableTag) { nameLabel.text = tag.name } override var isSelected: Bool { didSet { let style: UILabelStyle = isSelected ? .tagNameSelected : .tagNameUnselected nameLabel.applyStyle(style) } } } 67
  • 68. #3. BUILDING A NEW FEATURE IN IOS STEP #1: BUILD THE UI USING SWIFT > Builds shared (Kotlin) XCFramework once > Performs incremental Xcode builds > Write your code in Swift UI or UIKit VERDICT: FAST! 68
  • 69. #3. BUILDING A NEW FEATURE IN IOS STEP #2: TDD BUSINESS LOGIC ENTIRELY IN KOTLIN @Test fun `gives list of multiple tags with one selected in beat cache`() { spyStubBeatsCache.getBeat_returnValue = cacheBeatBuilder.withTags(setOf("rock")).build() spyStubTagsRepository.allTags_returnValue = setOf(Tag("latin"), Tag("rock")) val tags = presenter.tags assertEquals("latin", tags[0].name) assertEquals(false, tags[0].isSelected) assertEquals("rock", tags[1].name) assertEquals(true, tags[1].isSelected) } 69
  • 70. #3. BUILDING A NEW FEATURE IN IOS STEP #2: TDD BUSINESS LOGIC ENTIRELY IN KOTLIN class ManageTagsPresenter(...) : ManageTagsContract.Presenter { override val tags: List<SelectableTag> get() { val beatTags = beatDataMediation.beat.tags return tagsRepository.allTags.map { tag -> val isTagSelectedForBeat = beatTags.contains(tag.name) return@map SelectableTag(tag.name, isTagSelectedForBeat) } } } 70
  • 71. #3. BUILDING A NEW FEATURE IN IOS STEP #2: TDD BUSINESS LOGIC ENTIRELY IN KOTLIN 35ms to run these three tests! 71
  • 72. #3. BUILDING A NEW FEATURE IN IOS STEP #2: TDD BUSINESS LOGIC ENTIRELY IN KOTLIN > Does not require XC Framework to be built > Super fast tests and compilation > Quick TDD cycles (red - green - refactor) VERDICT: FAST! 72
  • 73. "But Derek, that was only three tests!" 73
  • 74. 376 TESTS → 674MS 74
  • 75. SO WHAT DOES THE BUILD PERFORMANCE LOOK LIKE? 75
  • 76. PERFORMANCE: BUILDING THE XCFRAMEWORK (2021 M1 MAX MACBOOK PRO | 64GB RAM) Module Files Lines of Code Scratch Build Re-Build GapClick Shared 62 2057 ~4-5sec ~1-2sec Drum Notation 32 1082 ~10sec ~1-2sec Beat Note Shared 328 15528 ~30sec ~1-2sec 76
  • 77. WAYS OF SHARING CODE > expect/actual > Kotlin interface + Swift Implementation > Kotlin Abstract Class + Swift Implementation > 100% Kotlin (shared) 77
  • 78. WAYS OF SHARING CODE See by blog post series on this for more details and code samples: ! The iOS Engineer’s Guide to Beginning Kotlin Multiplatform Development 78
  • 79. IMPORTANT SKILLS FOR MULTIPLATFORM DEVELOPMENT > Identifying dependencies in code (3rd party and platform) > Dependency Injection > SOLID: Single Responsibility > SOLID: Dependency Inversion 79
  • 80. JUST HOW MUCH CODE CAN BE SHARED? This depends on how creative you are, and... How clearly you can identify platform-specific dependencies and isolate them in your code. 80
  • 81. GAP CLICK CODE BREAKDOWN (GITHUB) But this is misleading... there are a lot of tests in Swift. 81
  • 82. GAP CLICK CODE BREAKDOWN (IOS) Module Files Lines of Code % Breakdown iOS App (Swift) 123 7239 78% KMM Shared (Kotlin) 62 2057 22% 82
  • 83. GAP CLICK CODE BREAKDOWN (ANDROID) Module Files Lines of Code % Breakdown Android App (Kotlin) 30 1624 22% Android App (C++) 20 1136 16% Android App (XML) 51 2449 34% KMM Shared (Kotlin) 62 2057 28% 83
  • 84. GAP CLICK CODE BREAKDOWN (TESTS) Module Files Lines of Code iOS Tests (Swift) 120 7098 ----- --- ---- Android Tests (Kotlin) 13 479 Android Tests (C++) 7 1739 84
  • 85. BEAT NOTE CODE BREAKDOWN (* Monorepo includes server + clients) 85
  • 86. BEAT NOTE CODE BREAKDOWN (IOS) Module Files Lines of Code % Breakdown iOS App (Swift) 217 16027 44½% KMM Shared (Kotlin) 333 15605 43½% Music Notation (Obj-C) 79 3177 9% Drum Notation Shared (Kotlin) 34 1108 3% 86
  • 87. BEAT NOTE CODE BREAKDOWN (ANDROID) TBD... 87
  • 88. Gap Click -vs- Beat Note Code Stats 88
  • 89. SUMMARY > KMM allows you to share common logic using Kotlin > Additional platforms can expand your reach > KMM can be adopted incrementally > There are several different ways to share code > KMM is in beta and the community is growing 89
  • 90. PLEASE SHARE YOUR FEEDBACK! ! HTTPS://FORMS.GLE/DKRDEQXM7SBXOAP99 THANK YOU! ! @DEREKLEEROCK [ALL SOCIALS] 90
  • 91. ADDITIONAL SLIDES FOR REFERENCE I WON'T COVER THESE IN THE PRESENTATION, BUT YOU MIGHT FIND THE INFORMATION HELPFUL. 91
  • 92. DEVELOPMENT ENVIRONMENT > Xcode/SPM > Android Studio/Gradle/Java > 3rd Party Dependencies and Plugins as needed 92
  • 93. POPULAR 3RD PARTY LIBRARIES > Ktor: Multiplatform Networking (client and server) https://github.com/ktorio/ktor > kotlinx-serialization: Multiplatform Serialization https://github.com/Kotlin/kotlinx.serialization > kotlinx-datetime: Multiplatform Date/Time https://github.com/Kotlin/kotlinx-datetime 93
  • 94. POPULAR 3RD PARTY LIBRARIES > Multiplatform-Settings: UserDefaults/Preferences https://github.com/russhwolf/multiplatform-settings > SQLDelight: Multiplatform SQLite Typesafe APIs https://github.com/cashapp/sqldelight > Kotlin Multiplatform Libraries Collection https://github.com/AAkira/Kotlin-Multiplatform- Libraries 94
  • 95. CODE SHARING: EXPECT/ACTUAL > Writing both Android and iOS code using Kotlin > Limited to Objective-C APIs (no Swift APIs!) > Sometimes frustrating how to write iOS code > I recommended using this only for building libraries > Others recommend this for Android developers 95
  • 96. CODE SHARING: KOTLIN INTERFACE + SWIFT IMPLEMENTATION > Ideal for objects that heavily rely on platform specific APIs > Recommended for iOS engineers over expect/actual > Write an interface in Kotlin > Implement the interface in Android as you would 96
  • 97. ABSTRACT CLASS + SWIFT IMPLEMENTATION > Similar to the previous, only the abstract Kotlin class can contain shared logic > Use abstract methods for implementing platform- specific details > Similar to the Template Object-Oriented Design Pattern 97
  • 98. 100% KOTLIN (SHARED) > Write all of your code in Kotlin! > Inject platform-specific dependencies as needed 98