How to find respective outlet connected to any UIView while viewing it in View Debugger?

305 views Asked by At

So i am going through this really old code of Swift 2 and i am fixing bugs in a certain module.

Now this module has a UITableView Cell and the person that worked on it has used Autoresizing on 10 labels inside the UITableViewCell.xib file and they are layed out randomly overalapped on each other. (yeah, big pain in the neck !)

Now, the frame of all the labels is being set out programatically, so I have no idea which frame is being set out for which label.

And the outlets of all the labels are not even named properly so i dont know which label contains the date, which contains the title, which contains the url and so on.Their outlets are named like label1,label2...label10.

My question is that, when i debug the view how do i found out the outlet which is connected to a specific label ?

Hope anybody cud help ?

1

There are 1 answers

2
Mahgolsadat Fathi On

open the xib file of your tableView Cell, then on the right top of Xcode there are 2 circles hugging each other , when u hover it a tooltip shows up "Show the Assistant Editor" click on that, so you can see both your tableVieCell class and xib file, hover over each outlets gray circle in your class ( I mean the circle which is shown in between number of each code's line) so the related label in xib file will light up