Watchkit Next page preventing buttons from performing segues.

475 Views Asked by At

I am working on a watchkit app and have a menu screen with a page based navigation (where you can swipe horizontally to view another controller). However, the buttons on the menu screen that are supposed to cause push segues (I did the segues graphically in the storyboard editor) no longer work. When I remove the page interface connection in the storyboard editor all works fine. Can anyone help me?

1

There are 1 best solutions below

0
On BEST ANSWER

Page-based and hierarchical navigation on watchOS are an either-or, you can't use both.

From the watchOS Human Interface Guidelines:

A watchOS app may include more than one screen. When this is the case, choose the navigation model that best meets your needs: page-based or hierarchical. You can’t use both models in one app.

And from App Programming Guide for watchOS: Interface Navigation:

For a Watch app interface with more than one screen of content, you must choose a technique for navigating between different screens. The Watch app interface supports two navigation styles, which are mutually exclusive:

  • Page based. This style is suited for apps with simple data models where the data on each page is not closely related to the data on any other page. A page-based interface contains two or more independent interface controllers, only one of which is displayed at any given time. At runtime, the user navigates between interface controllers by swiping left or right on the screen. A dot indicator control at the bottom of the screen indicates the user’s current position among the pages.

  • Hierarchical. This style is suited for master-detail interfaces, for presenting a navigable set of screens, or for cases where you might need to extend your app and add new content later. A hierarchical interface always starts with a single root interface controller. In that interface controller, you provide controls that, when tapped, push new interface controllers onto the screen.

Although you cannot mix page-based and hierarchical navigation styles in your app, you can supplement these base navigation styles with modal presentations. Modal presentations let you interrupt the current user workflow to request input or display information. You can present interface controllers modally from both page-based and hierarchical apps. The modal presentation itself can consist of a single screen or multiple screens arranged in a page-based layout.