scrollapple-watchwatchos-3

Apple Watch app scroll the view to top programmatically after launching app


I need to scroll to top the main Interface Controller of an Apple Watch app programmatically after each launch specially if users has left the app after scrolling it down.


Solution

  • EDIT: This is now possible in watchOS 4. Just use the scrollToObject:atScrollPosition:animated: method.


    Unfortunately, this isn't currently possible. WatchKit only provides a method to scroll to the top of a WKInterfaceTable, not an entire interface controller.

    The only workaround I've found is to hide every element in the interface controller. This doesn't just hide the element, it completely removes it from the controller. Then when you unhide everything, you'll be back at the top of your content.