apple-watchwkinterfacecontroller

WKInterfaceController top right button


On WKInterfaceController, is there a way to add a button (such as 'Done') at the top right corner of the watch screen instead of the time?


Solution

  • No. You can specify a 'title' for a presented modal controller, but it will always appear on the top left corner.

    If the modal interface controller does not have a title, its title is set to the string Cancel by default. You can set the value of this string in your storyboard or change it at runtime using the setTitle: method. When the user taps the title string, WatchKit automatically dismisses the modal interface without taking any further actions.

    Interestingly, Apple does happen to display Done on the right during modal text dictation. You could submit an enhancement request asking to substitute a 'title' in place of the time.

    enter image description here enter image description here