Search code examples
iosobjective-cuistoryboardapple-watchxcode-storyboard

Apple Watch Storyboard: Unsupported Configuration - Interface Controller is unreachable for a modal controller


I am developing UI for my watch app. I have a Home Interface Controller, and when a push notification arrives, a second Modal Interface Controller should show up.

I dragged the two interface controllers onto the storyboard. Usually, if there is a button/table cell etc on a controller, a modal segue can be created by dragging from the button to the modal controller. Since my modal controller is not presented by interacting with a button, but rather by responding to a push notification, I decided to present the modal controller programatically. (I can't seem to find a way to create a modal segue without a button in storyboard. Directly dragging from one controller to the other only presented me with the option of a next page segue, but no modal segue.)

However, if I do it in code, a warning will be shown in the storyboard saying my modal controller is unreachable. From the storyboard the modal controller does seem standalone and detached, but I am presenting it in code. Is there a way to make the warning go away?


Solution

  • For fixing that, you need to provide an Identifier for that particular View Controller. Go to the Attribute Inspector, In the Identifier field add a value. This value is used for accessing the View Controller via code, so it should be unique.

    enter image description here