I tested the app on my iPhone, but I thought that all the objects were deleted because only the background was showing up. When I checked if the rest still was there, I found out that the background was over the rest of the images and labels in a higher layer. How can I place the background in the lowest layer so the rest of the objects are on top of the background?
Asked
Active
Viewed 41 times
0
-
Possible duplicate of [How to set iPhone UIView z index?](https://stackoverflow.com/questions/4631878/how-to-set-iphone-uiview-z-index) – Tamás Sengel Feb 08 '18 at 15:16
1 Answers
1
You can use send(toBack: UIView) function of UIView to send the UIImageView subview to the back of the view hierarchy or you can adjust the zPosition of the image view's layer so send it to the back.
If your using interface builder, you can drag the background image view to the top of the list in the Document outline window.
Otherwise if you prefer to do it via code you can do something like this
override func viewDidLoad() {
self.view.send(toBack: backgroundImageView)
}

Scriptable
- 19,402
- 5
- 56
- 72