watchkitwatchos-2wkinterfacetable

How to create a Static Table in WatchKit


I am creating a table in my WatchKit app but I want it to be a static table.

How do I configure the table so it's static? I looked in the attributes inspector but there is no setting to change a dynamic table to a static table.


Solution

  • You can't, at present, since watchOS WKInterface tables are dynamic: they require you to programmatically configure both the number of rows and the row controllers.

    You could file a feature request with Apple. In the meantime, you could either

    The first option would require more code and classes. The second, while much simpler, is more fragile, as it would rely on Apple not changing the appearance for their table row.

    Alternatively, you could wait for the new watch OS to be presented at WWDC in a few weeks before making any decision.