swiftxcodemacosnsvisualeffectview

How can I move a visual effect view to the back in xcode so that I can see my UI in storyboard?


My application looks like this in xcode:

enter image description here

I want to add a transparency effect, so I add a visualEffectView. I get this:

enter image description here

Cool, it's made the window translucent. But now I can't see any of my UI. Same is true in my xcode storyboard, I can't see any of my UI:

enter image description here

So how do I move the visual effect view behind all of my other elements? Do I do this by changing the z index programatically? If I can do it programatically, how can I get it to also move behind the rest of my UI in storyboard? Any code that adjusts the z index will do so at compile-time, meaning I still won't be able to see my UI in xcode.

EDIT - I have since found the arrange tab under editor in the menu, but the buttons for send to back are greyed out:

enter image description here


Solution

  • You can use the list to the left of the storyboard to change the order (z-index) of the elements. Elements at the bottom of the list are positioned at the front and vice versa. You can simply drag elements up or down to reposition.