How to addSubview to the bottom of view hierarchy

SteBra picture SteBra · Jan 26, 2015 · Viewed 13.3k times · Source

I want to add mapView, which I'm adding programatically, to the bottom of hierarchy view, as I already draw some of the elements beforehand, in the storyboard.

So, after i call method:

[self.view addSubview:self.map];

How do I put it on the bottom of the view hierarchy ?!

Answer

Robert Gummesson picture Robert Gummesson · Jan 26, 2015

Just put it there directly instead.

[self.view insertSubview:_map atIndex:0];