title: UIButton action not called inside custom view
body: <p>I want to make a custom view, that will contain the following:</p>
  
  <ul>
  <li>a green view</li>
  <li>inside the green view an image view</li>
  <li>on top of this another white view</li>
  <li>another image view on top of the white view</li>
  <li>and on top of all an UIButton</li>
  </ul>
  
  <p>This is my code which is inside a custom view:</p>
  
  <pre><code>func setup() {
  
      // add green view
      let greenView = UIView(frame: CGRectMake(0, 0, frame.size.width, frame.size.height))
      greenView.backgroundColor = UIColor.greenColor()
      greenView.userInteractionEnabled = true
      addSubview(greenView)
  
      // add first image
      let image1 = UIImageView(frame: CGRectMake(0, 0, frame.size.width, frame.size.height))
      image1.image = UIImage(named: "checked2")
      image1.userInteractionEnabled = true
      greenView.addSubview(image1)
  
      // add white image
      let whiteView = UIView(frame: CGRectMake(0, 0, frame.size.width, frame.size.height))
      whiteView.backgroundColor = UIColor.yellowColor()
      whiteView.userInteractionEnabled = true
      greenView.addSubview(whiteView)
  
      // add second image
      let image2 = UIImageView(frame: CGRectMake(0, 0, frame.size.width, frame.size.height))
      image2.image = UIImage(named: "checked")
      image2.userInteractionEnabled = true
      whiteView.addSubview(image2)
  
      // add button
      let button = UIButton(frame: CGRectMake(0, 0, frame.size.width, frame.size.height))
      button.backgroundColor = UIColor.redColor()
      button.addTarget(self, action: Selector("animation:"), forControlEvents: UIControlEvents.TouchUpInside)
      button.userInteractionEnabled = true
      addSubview(button)
  
  
  
  }
  
  func animation(button: UIButton) {
      print("tapped")
  }
  </code></pre>
  
  <p>The button, which is red appears on top, but the action is not called when clicking on it.<br>
  I tried to set <code>userInteractionEnabled</code> on all of the elements, but with no effect.</p>