https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
k

kpgalligan

11/28/2018, 6:13 PM
Are there any good tutorials on multiplatform, specifically for native mobile? I'm sort of really deep in the weeds on it, and am trying to bring some of the team up to speed and realizing how much needs to be explained.
unless that's too hello world for your needs
k

kpgalligan

11/28/2018, 6:22 PM
No. I need "from scratch". The main dev right now I'm trying to onboard is primarily an ios/swift dev. Interesting perspective. Years ago I was trying to walk my aunt through a computer problem over the phone. "Click x, you should see y", and she kept saying it wasn't working. Took a while till I figured out, "LEFT-click x, ...". We're sort of there. So many assumptions when talking to an Android dev.
However, the similarities of swift to kotlin make some things easier. Trying to get a Java dev used to kotlin is tough. I don't need to explain extension functions to a Swift dev, for example.
r

russhwolf

11/28/2018, 6:26 PM
Yeah I guess most materials I'm aware of come assume you're coming from Java or Kotlin/JVM
k

kpgalligan

11/28/2018, 6:28 PM
I'm starting an outline of a class to teach. Not that I do this kind of stuff, but assuming we'll be onboarding people internally, will need it. The kotlin/jvm stuff should be external, but once we get into expect/actual, etc, the stuff I'm finding out on the web is either kind of outdated or, frankly, wrong.
r

russhwolf

11/28/2018, 6:29 PM
Yeah that sounds like an interesting project
I haven't looked closely at it but you could also try this recent Ray Wenderlich post: https://www.raywenderlich.com/7357-ios-app-with-kotlin-native-getting-started
k

kpgalligan

11/28/2018, 6:42 PM
Ah, just talked to them at droidcon sf. Said they were going to be doing a bunch more stuff.
k

kenkyee

11/28/2018, 7:11 PM
Would love to see the class guide if you do end up doing that to onboard people 🙂
d

drofwarcs

11/29/2018, 3:18 AM
@russhwolf you beat me to the punch, was going to post that....especially since I'm the author 🙂. @kpgalligan that post is geared at 100% Kotlin on iOS only(no mpp). But it does cover alot of things that iOS developers wanting to see how kotlin works/interop with iOS looks like
The main thing missing is how memory management work and the threading model, which I think will be an interesting conversation starter for native iOS developers lol
r

russhwolf

11/29/2018, 3:33 AM
Well the fun thing about threading and memory on K/N is it’s generally pretty new and unfamiliar regardless of which platform you’re coming from.
k

kpgalligan

11/29/2018, 3:41 AM
"the fun thing"
😂 1
😛 1
d

Dico

11/29/2018, 10:48 AM
Frankly, it's just a hurdle for everyone to jump over in order to use kotlin native, and its restrictions apply to common code in multiplatform projects. I haven't even considered trying to do multithreading there.
No offense intended to the developers
l

louiscad

11/29/2018, 11:05 PM
@drofwarcs Do you think reading a getting started book at iOS 3-4 time (consequently Obj-C) may help an experienced Android developer like me make a 100% Kotlin iOS app (with shared code where possible)?
k

kpgalligan

11/30/2018, 12:06 AM
Multithreading common isn't too bad once you get the rules. It's definitely something you'll need to understand to do anything reasonably involved. Even if you're not managing threads in common code, you'll eventually have to understand how having that code called from multiple threads will impact your project.
d

drofwarcs

11/30/2018, 2:12 AM
@louiscad that will be a good start. The main things you need learn is the frameworks, the lifecycle stuff, frameworks, and the basic stuff with ARC and memory management. I wouldn't suggest a 100% Kotlin iOS app however. Working with Storyboards can get really big and working with them manually can be really error prone. Also, the swift/objc/kotlin interop is awesome enough where you can work with the language that works best for the needed task(i.e. swift for ViewControllers/Views, Kotlin for business logic and shared code)
l

louiscad

11/30/2018, 7:32 AM
@drofwarcs Thanks for the advice! About storyboards, it's been a year I write Android UIs without xml, using self-made, then open sourced Splitties Views DSL (a lighter and more flexible #anko alternative), so I will try to make UIs with just Kotlin code, without involving storyboards at all, likely making something like Splitties Views DSL for iOS in the process. This is achievable, right? Then, no need for Swift, is that right?
s

Sam

11/30/2018, 1:01 PM
Yes. You can do an app entirely in code without storyboards. I wouldn’t say it is a 50/50 split but there is a significant amount of developers that prefer to do a UI in code over storyboards. The newer anchor syntax for layout constraints makes it a lot cleaner. You’ll still want to develop some higher level positioning functions like
pin
that generate all the constraints needed.
☝️ 2
d

drofwarcs

11/30/2018, 2:41 PM
As a side note, that tutorial uses AppCode 2018.2. Appcode 2018.3 came out recently but does not have a compatible Kotlin Native plugin yet. So stick with 2018.2 if you are going through the tutorial.
👍 1
3 Views