title: UIButtons not working on programmatically created UIView
body: <p>I have a <code>UIViewController</code> which I want to display a <code>UIView</code> that renders as a menu. This menu will have several buttons on it. I wanted to reuse this menu a few different places in my app so I figured I would create a class called <code>ViewFactory</code> that has a method that returns a <code>UIView</code> with these buttons.</p>
  
  <p>On my <code>ViewController</code> I call this method and get the returned <code>UIView</code> and add it as a subview.</p>
  
  <p>This works just fine. I can see the view and all its buttons, however, the buttons do not respond to any touch events. Not sure why this is the case and curious to know what I am doing wrong.</p>
  
  <p>Here is my code for the <code>ViewFactoryClass</code>:</p>
  
  <pre><code>- (UIView *) addCloseRow
  {
      // UIView container for everything else.
      UIView *navRow = [[UIView alloc] initWithFrame:CGRectMake(0,225,350,45)];
  
      UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
      button.userInteractionEnabled = YES;
  
      [navRow addSubview:button];
  
      [button addTarget:self action:@selector(closeButtonTouchDownEvent) forControlEvents: UIControlEventTouchDown];
      navRow.userInteractionEnabled = YES;
      return navRow;
  }
  </code></pre>
  
  <p>In my main <code>NavigationController</code> class  here is how I am calling and getting the <code>UIView</code>:</p>
  
  <pre><code>ViewFactory *factory = [[ViewFactory alloc] init];
  [self.navigationController.navigationBar addSubview:[factory MainNavigationUIView]];
  </code></pre>
  
  <p>Again, the <code>UIView</code> shows up but the buttons never respond to anything.</p>