title: Display UIView while waiting for main view to load?
body: <p>So I am trying to create somewhat of a loading screen in my application. I have a view that takes 3-10 seconds to load. During this time I want to display a UIView that I made that is simply black with a loading screen. Currently I am putting my code inside of the viewDidLoad function just after super viewDidLoad. Here is my code </p>
  
  <pre><code>UIView* baseView = [[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]];
  [self.view addSubview:baseView];
  [baseView setBackgroundColor:[UIColor blackColor]];
  [self.view bringSubviewToFront:baseView];
  baseView.layer.zPosition = 1; 
  </code></pre>
  
  <p>This works and creates my view overtop of everything exactly how I want it, however this waits until my main view is completely done loading before it actually shows anything. Is viewDidLoad not a good place to put this and if so where should I put it. </p>
  
  <p>Simply put I have a very basic UIView that I want to load while I wait for the actual view to load and then simply hide it. Any ideas how to do this? </p>