Is there a way to avoid this behavior. I update the watch app interface with new data when app enters foreground. Is that not the recommended time to do that? The view controller is the first page within a page based navigation pattern.
Asked
Active
Viewed 665 times
5
-
1You might be able to find out why you're seeing that behavior by looking at my Watch OS 1.0.1 Controller Life Cycle post: http://blog.mikeswanson.com/post/119399948909/watch-os-1-0-1-controller-life-cycle-changes – Mike Swanson Jun 10 '15 at 12:03
-
I took a look, and yes, it confirms that if it's the first page as part of page navigation, when the view comes back in the foreground, willActivate gets called twice. I am trying to understand the reasoning behind it and how to avoid refreshing the interface twice. For the time being I just check to see if the call happens within the same second and if so, ignore the latter one. – oviroa Jun 10 '15 at 19:43
-
I think if you app is in background, let's say you have a background task will refresh your tableview. When UI is refreshed, the `willActivate` method will be called in this controller. – Alex L Apr 10 '19 at 14:29
-
Use the `didAppear()` method to determine when your interface appears onscreen. – Alex L Apr 10 '19 at 14:36