[Solved] My team is using UIKit with Kotlin/Native...
# ios
l
[Solved] My team is using UIKit with Kotlin/Native on a project, and we’re seeing an interesting error pop up in Crashlytics, but specifically for iOS/iPadOS 13
We use actionWithHandler to define button handlers, and we’re seeing
Copy code
+[UIAction actionWithHandler:]: unrecognized selector sent to class 0x1d7445ab8
in Crashlytics.
This only affects iOS 13 users. Is there a known issue regarding this?
It's 14.0+
l
That explains it.
What should I use pre-14 when I do this in Koltin?
h
Good question 😄 But I guess there have to be some older implementation
l
The only method I’m aware of currently is to annotate with IBAction and let storyboards handle it, but that doesn’t seem to work unless I use Swift/Objective-C. I’d imagine there’s something I can do, though.
h
What about this one? https://developer.apple.com/documentation/uikit/uiaction/3340167-actionwithtitle?language=objc The swift implementation has nullable parameters
l
I’ll look into that one.
@hfhbd it looks like actionWithTitle didn’t solve it.
Same issue.
Looks like UIButtons didn’t work with actions in 13 https://www.samurai-digital.com/how-ios14s-uiaction-reduces-repetitive-code/
Guess I’ll have to use selectors…