Xcode: go to output definition

So, I'm starting from the background in C # WinForms / WPF and trying to make my head wrap around how Xcode connects the visual elements of the user interface in Interface Builder with their entities in the code.

In WPF, I use simply defining an element identifier and then accessing it as a member of the code. In JavaScript, this is similar, except that I have to call document.getElementById first.

However, Xcode and its outputs do cast me for a loop. Say I have an interface and create a view in a window. Now I want to have access to this view programmatically, but first I have to determine the output for this view and graphically β€œbind” the view to the outlet? Complaints about unnecessary work aside, my next question is, is there a quick and easy way to get this definition of exit from Interface Builder?

In the code, I can click on the identifier to go to its definition, but this does not work in this window:

enter image description here

I just want to go to the definition of menu so that I can work with it. Is there a shortcut for this, or do I need to find the controller file and search for the "menu" on my own?

+4
source share
1 answer

Use the assistant editor! It can automatically follow when selecting objects in Interface Builder, showing their header files.

Then, to create your own outlet, instead of writing down a definition and dragging controls in Interface Builder, you can simply drag and drop from the Interface Builder view to an empty space in the header file in the other half of the editor assistant.

0
source

Source: https://habr.com/ru/post/1469074/


All Articles