leandro
04/19/2023, 10:20 AM.animation(_:, value: <a kotlin integer>)
The animation does not get executed, and I have to wrap it around a Swift Int, like so:
.animation(_:, value: Int(<a kotlin integer>))
Anonymike
04/20/2023, 3:07 PMleandro
04/20/2023, 3:23 PMAnonymike
04/20/2023, 3:47 PMleandro
04/20/2023, 4:40 PMAnonymike
04/20/2023, 5:27 PM@State var myInt: Int = 0
in Swift and adding some simple logic to change it when you click a button to see how the animation works in Native Swift. Then you will need to figure out how you want to make that property powered by your Kotlin code. There are several ways to do it, but the common pattern is to convert a Kotlin MutableStateFlow<Int> and wrap that with an iOS native ObservedObject or Publisher to update your property from Kotlin. Awesome libraries/frameworks like Decompose and KMMViewModel ultimately just level this up to make it more natural while Kotlin Multiplatform matures.leandro
04/20/2023, 7:40 PM@StateObject
. I didnt know that I couldn't refer to a property of a @StateObject
directly.Anonymike
04/21/2023, 6:00 PM