Storyboard Assistant Editor doesn't open associated file

When I click on a a view controller on storyboard it doesn't show associated file in assistant editor, it shows UIResponder.h instead. If I click on any view inside this view controller then it opens correct associated file. It's happening in an old project which I'm editing now. Is this a bug or settings issues. How to fix this?

Replies

See this thread for similar problem and hopefully some solution.


https://forums.developer.apple.com/message/387103#387103

I've already read that thread but can't figure out what the solution is. If anyone knows answer then let me know.

In the top bar, select 'Top level objects' instead of 'Automatic'.


When you change VC in storyboard, it will show the controller code.


This lasts for the whole session, but not if you close and reopen XCode. You'll have to reset to Top level objects…

Thanks for reply.

It helps but this selection doesn't last when I click on Jump to Definition and come back to the file. Is there any settings which will keep Top level object permanently?

Suggest you update to Xcode 11.2.1 instead, then ask for help if your issue persists.

This post solved the issue for me, thanks. In Xcode 11,there is an alternative for assistant editor, you can click on the icon (which is two vertical rectangles with a plus sign in the 2nd one) found on the right of the assistant editor icon(which is a series of horizontal lines) found at the top right. This displays another editor panel on the right, then you can select the file you want to edit alongside the storyboard and voila, the editor on the right serves as your assistant editor