Search code examples
iphoneuiviewsubview

send subview to the back


I know of a function that brings a view to the front.

  [self.view bringSubviewToFront:myView];

I am wondering if there is a function that sends a subview to the back.


Solution

  • Try,

    Objective-C:

    [self.view sendSubviewToBack: yourView];
    

    Swift:

    self.view.sendSubview(toBack: yourView)