title: UIView added as an UIWindow subview doesn't respond to taps
body: <p>I've added a <code>UIView</code> containing a <code>UITapGestureRecognizer</code> as my key window's subview. It shows properly, however when I tap my view, the target method is not fired. I've even tried to replace the gesture recognizer with a <code>UIButton</code>, still to no avail.</p>
  
  <p>Here is my code.</p>
  
  <p><strong>NotificationView.h</strong></p>
  
  <pre><code>#import &lt;UIKit/UIKit.h&gt;
  
  typedef NS_ENUM(int, NotificationKind) {
      NotificationKindActivity,
      NotificationKindReply,
  };
  
  @interface NotificationView : UIView {
  
      NotificationKind currentNotificationKind;
  
  }
  
  -(id)initWithMessage:(NSString*)message andColor:(UIColor*)color andKind:(NotificationKind)kind;
  -(void)show;
  
  @end
  </code></pre>
  
  <p><strong>NotificationView.m</strong></p>
  
  <pre><code>#import "NotificationView.h"
  
  @implementation NotificationView
  
  - (id)initWithMessage:(NSString*)message andColor:(UIColor*)color andKind:(NotificationKind)kind
  {
      self = [super initWithFrame:CGRectMake(0, 0, CGRectGetWidth([UIScreen mainScreen].bounds), 60)];
      if (self) {
          // Initialization code
          [self setAlpha:0];
          [self setBackgroundColor:color];
          [self setUserInteractionEnabled:YES];
  
  
          currentNotificationKind = kind;
  
          UILabel *label = [[UILabel alloc] initWithFrame:self.bounds];
          [label setNumberOfLines:0];
          [label setFont:[UIFont fontWithName:@"Roboto-Italic" size:20]];
          [label setTextColor:[UIColor whiteColor]];
          [label setTextAlignment:NSTextAlignmentCenter];
          [label setPreferredMaxLayoutWidth:290];
          [label setText:message];
          [label setUserInteractionEnabled:YES];
          [self addSubview:label];
  
          UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(notificationTapped)];
          [tap setNumberOfTapsRequired:1];
          [self addGestureRecognizer:tap];
  
          [[[UIApplication sharedApplication] keyWindow] addSubview:self];
  
      }
      return self;
  }
  
  -(void)show{
      [UIView animateWithDuration:0.3 animations:^{
  
          [self setAlpha:1];
  
      } completion:^(BOOL finished) {
  
          [UIView animateWithDuration:0.3 delay:3 options:UIViewAnimationOptionCurveLinear animations:^{
              [self setAlpha:0];
  
          } completion:^(BOOL finished) {
              [self removeFromSuperview];
          }];
  
      }];
  }
  
  -(void)notificationTapped{
  
      DDLogDebug(@"Notification tapped!");
  
  }
  
  @end
  </code></pre>