0

I load the data from NSURL from internet and show up the data by WKInterfaceTable. My Table have about 82 rows with text inside each row. When I run the code, my table show up the data row by row and it's take about 2 - 3 seconds to show up all the data on my table. I have a function to show up new WKInterface when user press a row:

override func table(table: WKInterfaceTable, didSelectRowAtIndex rowIndex: Int) {

    self.pushControllerWithName("detail", context: nil)
}

but I got a problem, My application will not push the "detail" WKInterface if I press the row when my table didn't load all data yet. I have to wait 2-3 seconds when my table show up all the data and after that every function working fine. How can I call the function to push the detail WKInterface when my table is showing the data?

Jay Mehta
  • 1,431
  • 19
  • 40
Hieu Duc Pham
  • 1,074
  • 1
  • 10
  • 24

2 Answers2

0

You can put the loading function in - (void)willActivate. Make sure that “Hides when Loading” is checked on the Storyboard. This will show a spinner that won't go away until you've left the method.

For a better user experience, I'd suggest displaying a Modal WKInterfaceController that blocks the UI while the information is loading. Also, try to limit how many rows are needed.

enter image description here

SushiGrass Jacob
  • 19,425
  • 1
  • 25
  • 39
0

I move the loading data on WKInterface Table to another thread using the dispatch_assync and that method working fine.

Hieu Duc Pham
  • 1,074
  • 1
  • 10
  • 24