send subview to the back

SirRupertIII picture SirRupertIII · Sep 29, 2012 · Viewed 16.4k times · Source

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.

Answer

Krunal picture Krunal · Sep 29, 2012

Try,

Objective C:

[self.view sendSubviewToBack: yourView];

Swift:

self.view.sendSubview(toBack: yourView)