Home > Blockchain >  How to @IBOutlet in the storyboard?
How to @IBOutlet in the storyboard?

Time:12-20

Watch question I am new to iOS development. I got a project to maintain, the problem is that I can't find where in the storyboard belongs the variable. For example, in my ViewControl there is such a line

...
@IBOutlet weak var imgBottomFade: UIImageView!
...

So, I need to find this UI view in the storyboard, I open storyboard, but I see there are more than 10 screens each of them pretty sophisticated, and I start to click on each view on the screen and check the name (equal to imgBottomFade), one view by another, one screen by another... pretty annoying, I believe in XCode should be kind of way to find out where the UI view connects from Controller to Storyboard.

Let me know what I missed?

CodePudding user response:

What you could do:

-open both code file and storyboard

-zoom out to view the whole storyboard (25% or smaller scale factor) move mouse over the black dot in front of IBOutlet

-observe carefully in storyboard: you should see the UIImageView highlighted

or

-search for imgBottomFade in the search bar (at the very top left)

-you will find at the end of the list a reference to Main

-click it

-that will position the storyboard on the relevant VC

-expand view in the left panel of storyboard

-you should easily find imgBottomFade in the list of objects.

or

-search ViewControl VC in storyboard (just 10 to inspect)

-select it and expand its view object in the left panel of storyboard.

-you should find imgBottomFade in the list of objects.

  • Related