Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make Object ID human-readable?

Tags:

ios

storyboard

Each UIView on a storyboard has a unique Object ID which looks something like: kvf-NI-koG

enter image description here

I'm wondering is there a way to make this more human-friendly, for example 'myLabel'?

like image 540
Vitaly Stakhov Avatar asked Jun 11 '15 18:06

Vitaly Stakhov


1 Answers

You cannot change the object ID through Interface Builder.

Xcode uses the object ID in the storyboard (or XIB) file to refer to that object from other objects. Since a storyboard (or XIB) is an XML file, you can also “diff” versions of the file to try to understand (or merge) changes, and the object ID can help you correlate the entities in the file with the objects in Interface Builder.

The public API doesn't expose the object ID. So from your program's point of view, the object ID doesn't even exist.

You can set the view's label (in the text box with placeholder “Xcode Specific Label”). That label is used in the document outline (along the left side of the Interface Builder pane), and when wiring up connections and constraints. But that label is also not exposed to your program in the public API.

like image 68
rob mayoff Avatar answered Sep 28 '22 06:09

rob mayoff