title: ios subview not responding to touch events
body: <p>I am trying to create a basic card flip animation for one of my view controllers.  Here is the current setup:</p>
  
  <p>I have the base ViewController, this view controller has an XIB with a subview called containerView (shown below).</p>
  
  <p><a href="https://i.stack.imgur.com/VJpB6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VJpB6m.png" alt="enter image description here"></a></p>
  
  <p>This container view basically then holds the two states of the "card" thats flipping.  I have a UIView subclass to represent the cardFront and the cardBack.  In the ViewController, I have some code in viewDidLoad to get a reference to both views:</p>
  
  <p><strong>ViewController.m</strong></p>
  
  <pre><code>cardFront= [[UICard alloc]initWithType:YES];
  cardBack = [[UICard alloc]initWithType:NO];
  containerView.userInteractionEnabled = YES;   
  [containerView addSubview:cardBack];
  </code></pre>
  
  <p>Then, I basically just add and remove the subviews to containerView, with a small animation.  </p>
  
  <p>Then, I have two XIB's, one for cardFront, one for cardBack, and UICard decides which view to inflate.  So UICard looks like this:</p>
  
  <p><strong>UICard.m</strong></p>
  
  <pre><code>-(id)initWithType:(BOOL)front{
      self = [super init];
      self.isFront = front;
  
      if(isFront){
          [[NSBundle mainBundle] loadNibNamed:@"CardFront" owner:self options:nil];
      }
      else{
          [[NSBundle mainBundle] loadNibNamed:@"CardBack" owner:self options:nil];
      }
      [self addSubview:self.view];
  
  
      self.view.userInteractionEnabled = YES;
  
  
  
      return self;
  }
  //..later on, when i want to flip the card
  [UIView transitionWithView:containerView
                            duration:0.5
                             options:UIViewAnimationOptionTransitionFlipFromLeft
                          animations:^
                          {
                              [cardFront removeFromSuperview];
                              [containerView addSubview:cardBack];
                              cardFront.isShowing = NO;
                              cardBack.isShowing = YES;
                              isFlipping = NO;
                          }
                          completion:NULL];
  </code></pre>
  
  <p>Pretty straight forward.  The problem is, no clicks get registered in my UICard view (either front or back).  I have buttons, etc, that just dont recieve any user interaction.  To test, I've placed </p>
  
  <pre><code>- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{
  </code></pre>
  
  <p>and</p>
  
  <pre><code>-(UIView *) hitTest:(CGPoint)point withEvent:(UIEvent *)event{
  </code></pre>
  
  <p>in UICard.m, Neither get called in the UICard class.  All that I can think is that somehow the containerView is stealing all of the touch events, but in iOS (I beleive) the lowest subview gets the clicks first.  Anyone got any ideas on what could be going on here??</p>
  
  <p>Edit:
  Here is a picture of the cardBack.xib.  I wired up the view(files owner) to UICard's view property</p>
  
  <p><a href="https://i.stack.imgur.com/AEN9O.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/AEN9Om.png" alt="enter image description here"></a></p>