How to send objects in NIB files to front/back?

69,943

Solution 1

Just to give a clean, up-to-date answer to this:

  1. Select an interface object, then "Editor | Arrange | Send to back/front/etc", OR

  2. Select the window object, then click on 'Window' above the interface editor and select the objects it contains

    • This pic shows where to click: enter image description here
  3. Or you can expand the object browser, use the disclosure triangle on the window object, and select from the list there: http://i.imgur.com/041xz.png

  4. If the option to send to front/back is greyed out, try double-clicking the object to select it.

    • Thanks to Bryce Thomas for this suggestion in the comments
  5. Alternatively, the objects are listed from back to front in the order that they appear in the object browser list.

    • Drag an object in the list to the last slot in the list to bring it to the front, for example.

Solution 2

I know originally, this question was for Xcode 4, but it is linked from a Google search.

In Xcode 5, 6, and 7, you can still go to the Editor menu and select and move the items around.

Image of Editor Menu

But you can also rearrange by simply changing the order in the document outline.

Example of UI Items in a UIView

They're in reverse z-index order: the top of the list is the back of the stack, the bottom of the list is the front. Simply drag your UI item to the bottom to bring it to the front.

Solution 3

Found it: Click on the object you want to move and in the menubar, select Editor > Arrangement

Solution 4

Also, click on the triangle (open) at the bottom of the column showing the view/objects/placeholder/window. Then you have the full hierarchy of objects, like from IB, and can rearrange by dragging.

Solution 5

Click on the item you want to send back. From the top menus choose: Editor -> Arrange -> Send to back/front.

Share:
69,943
Joe
Author by

Joe

Updated on May 28, 2020

Comments

  • Joe
    Joe almost 4 years

    How can I adjust the "z"-positions of objects (e.g. sending UIImageViews to the front/back) in the integrated interface builder in Xcode?

  • Luke
    Luke almost 13 years
    I wanted it to be completely unambiguous as to where they should click.
  • IcyBlueRose
    IcyBlueRose almost 11 years
    Your last tip there about the greyed out objects really helped me. Thanks!
  • Bryce Thomas
    Bryce Thomas almost 11 years
    Protip: if you're selecting the view/object in the list of objects on the left hand side (I don't know what version of XCode it was introduced in), you have to double click the object for it to become selected(?), which seems to resolve the issue of XCode greying out the send to front/back options.
  • jungledev
    jungledev over 8 years
    @BryceThomas excellent double-click tip! You should submit this as a formal answer so other users don't miss it.