title: iOS bring subview to back
body: <p>I want ot bring a view to appear on the top of another view.</p>
  
  <p>Here is my view hierarchy:</p>
  
  <p><a href="https://i.stack.imgur.com/KPxeM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KPxeM.png" alt="enter image description here"></a></p>
  
  <p>Basically I want to bring the button(Start Again) in front of the UIImageView which belongs to PageViewController. So I want to be able to scroll with the button on the top of the images.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>- (void)viewDidLoad
  {
      [super viewDidLoad];
      // Create the data model
      _pageTitles = @[@"Over 200 Tips and Tricks", @"Discover Hidden Features", @"Bookmark Favorite Tip", @"Free Regular Update"];
      _pageImages = @[@"page1.png", @"page2.png", @"page3.png", @"page4.png"];
  
      // Create page view controller
      self.pageViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"PageViewController"];
      self.pageViewController.dataSource = self;
  
      PageContentViewController *startingViewController = [self viewControllerAtIndex:0];
      NSArray *viewControllers = @[startingViewController];
      [self.pageViewController setViewControllers:viewControllers direction:UIPageViewControllerNavigationDirectionForward animated:NO completion:nil];
  
      // Change the size of page view controller
      self.pageViewController.view.frame = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height - 30);
  
      [self addChildViewController:_pageViewController];
      [self.view addSubview:_pageViewController.view];
      [self.pageViewController didMoveToParentViewController:self];
  
  }
  </code></pre>