Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I find the file my storyboard outlet connects to?

Tags:

xcode

swift

This may be a silly question.

I know I can easily go to my storyboard from my outlet e.g.

enter image description here

Is there an easy way to do the reverse? I'd like to go from my storyboard element to my swift file, specifically the line of code where the outlet is declared.

enter image description here

like image 317
jtwaller Avatar asked Dec 06 '25 20:12

jtwaller


1 Answers

I'm not aware of any shortcut link back to the declaration of an outlet. A couple of alternatives are:

  1. Use the Assistant Editor (it's the middle button below with the two overlapping rings) while you have a View Controller or an element within it selected in a storyboard. It will load up the accompanying class in a panel beside the storyboard view.

    enter image description here

  2. Select the View Controller itself out of the hierarchy, go to the Identity Inspector on the right, and tap the little gray circle icon with a white arrow in it beside the class name. That will take you to the class file in the main editor.

    enter image description here

Those are the only two methods I know of for getting to the associated class.

like image 98
Christopher Griffith Avatar answered Dec 11 '25 05:12

Christopher Griffith



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!