In the default Kotlin/native AppCode application d...
# kotlin-native
s
In the default Kotlin/native AppCode application demo, I see the following code snippet:
Copy code
@ObjCAction
    fun buttonPressed() {
        label.text = "Konan says: 'Hello, ${textField.text}!'"
    }
It's not clear how the
@ObjCAction
is routing to the button that's being pressed. It's also not clear how that button is being selected. Can anyone point me in the right direction?
v
This relationship is established in the storyboard:
Copy code
<connections>
  <action selector="buttonPressed" destination="BYZ-38-t0r" eventType="touchUpInside" id="frh-jo-ppG"/>
</connections>
This can also be done programmatically: https://developer.apple.com/documentation/uikit/uicontrol/1618259-addtarget?language=objc
s
Thanks 🙂
d
Looks like it's Kotlin version of
@IBAction