Search code examples
swiftwatchkitapple-watch

WatchKit How set a string when a certain table is pressed?(Swift)


Im creating a watch app but i have a problem and that is that i want to set a string depending on which table the person pressed in the watch app.

Can anyone help me?????


Solution

  • If I understand correctly you're trying to perform an action when a user taps on a WKInterfaceTable row?

    You can achieve this using table:didSelectRowAtIndex: by identifying the corresponding string based on the index and sending an appropriate message to the string.

    See the WKInterfaceTable Class Reference