title: iOS UITextField Outside of SuperView not Responding to Touches
body: <p>I'm building an iOS 8 app that makes use of the new <code>hidesBarsOnSwipe</code> property on <code>UINavgitationController</code> to hide the nav bar while scrolling. At the same time that the nav bar hides, I'm also programmatically hiding the tab bar. On top of the tab bar, there is a text field which lets users comment on a post (much like Facebook). When the tab bar is hidden (by moving it downward and off the screen), the text field is moved down as well, so that it now sits at the bottom of the screen and so that there's no gap between the bottom of the screen and the text field.</p>
  
  <p>So, things look great. But, turns out that the text field doesn't respond to touch events when it moves to the bottom of the screen. I did some digging and it appears that the reason is because the text field is outside of its superview (the view controller's view), and so touch events will not be sent to the text field.</p>
  
  <p>So I think I've figured out <em>why</em> the issue is occurring, but I haven't yet figured out how to fix it. I've tried messing with <code>hitTest:withEvent:</code> and <code>pointInside:withEvent:</code> but didn't have any luck. Anyone have any solutions? </p>
  
  <p>EDIT: Here is some code to make the question clearer (hopefully). When the nav controller's <code>barHideOnSwipeGestureRecognizer</code> is called, I am running the following code:</p>
  
  <pre><code>- (void)barHideSwipeGestureActivated:(UIPanGestureRecognizer*)gesture
  {
      [self animateTabBarUpOrDown:self.navigationController.navigationBar.frame.origin.y &gt;= 0 completion:nil];
  }
  </code></pre>
  
  <p>The method above is the following:</p>
  
  <pre><code>- (void)animateTabBarUpOrDown:(BOOL)up completion:(void (^)(void))completionBlock
  {
      if(!self.animatingTabBar &amp;&amp; self.tabbarIsUp != up)
      {
          self.animatingTabBar = YES;
          //to animate the tabbar up, reset the comments bottom constraint to 0 and set the tab bar frame to it's original place
          //to animate the tabbar down, move its frame down by its height. set comments bottom constraint to the negative value of that height.
          [UIView animateWithDuration:kTabBarAnimationDuration animations:^{
              UITabBar *tabBar = self.tabBarController.tabBar;
              if(up)
              {
                  tabBar.frame = CGRectMake(tabBar.frame.origin.x, tabBar.frame.origin.y - tabBar.frame.size.height, tabBar.frame.size.width, tabBar.frame.size.height);
                  self.addCommentViewToBottomConstraint.constant = 0.0f;
              }
              else
              {
                  tabBar.frame = CGRectMake(tabBar.frame.origin.x, tabBar.frame.origin.y + tabBar.frame.size.height, tabBar.frame.size.width, tabBar.frame.size.height);
                  self.addCommentViewToBottomConstraint.constant = -tabBar.frame.size.height;
              }
          } completion:^(BOOL finished) {
              self.tabbarIsUp = up;
              self.animatingTabBar = NO;
              if(completionBlock)
              {
                  completionBlock();
              }
          }];
      }
  }
  </code></pre>