https://kotlinlang.org logo
#ios
Title
# ios
l

Landry Norris

08/17/2022, 4:52 PM
[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

Landry Norris

08/18/2022, 2:17 PM
That explains it.
What should I use pre-14 when I do this in Koltin?
h

hfhbd

08/18/2022, 2:27 PM
Good question 😄 But I guess there have to be some older implementation
l

Landry Norris

08/18/2022, 2:29 PM
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

hfhbd

08/18/2022, 2:29 PM
What about this one? https://developer.apple.com/documentation/uikit/uiaction/3340167-actionwithtitle?language=objc The swift implementation has nullable parameters
l

Landry Norris

08/18/2022, 2:29 PM
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…
28 Views