title: Button in view not clicking ios swift
body: <p><a href="https://i.stack.imgur.com/evKEZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/evKEZ.png" alt="enter image description here"></a></p>
  
  <p>I'm trying to implement a dropdown menu in Swift by adding a view below the navigation bar and initially setting it to hidden until a navigationBarItem button is pressed, which works. In the dropdown View I have added two buttons as seen in the code below but it doesn't seem to pick up the event.</p>
  
  <pre><code>var isAnimating: Bool = false
  var dropDownViewIsDisplayed : Bool = false
  var dropDownView : UIView!
  
  var buttonOne : UIButton!
  var buttonTwo : UIButton!
  
  var screenWidth : CGFloat!
  
  @IBOutlet weak var searchNavigationBar: UINavigationItem!
  
  override func viewDidLoad() {
      super.viewDidLoad()
  
      screenWidth = self.view.bounds.size.width
      self.navigationController?.navigationBar.translucent = false
      dropDownView =  UIView(frame: CGRectMake(0, -15, screenWidth, -80))
  
      dropDownView.hidden = true
      dropDownView.userInteractionEnabled = true
      self.navigationController?.view.insertSubview(self.dropDownView, belowSubview: (self.navigationController?.navigationBar)!)
  
      buttonOne = UIButton(frame: CGRectMake(0, 0, screenWidth, 40))
      buttonOne.setTitle("Button One", forState: .Normal)
      buttonOne.setTitleColor(UIColor.blackColor(), forState: .Normal)
      buttonOne.backgroundColor = UIColor.whiteColor()
      buttonOne.addTarget(self, action: Selector("buttonOnePressed"), forControlEvents: UIControlEvents.TouchUpInside)
      buttonOne.userInteractionEnabled = true
      dropDownView.addSubview(buttonOne)
  
      buttonTwo = UIButton(frame: CGRectMake(0, buttonOne.bounds.size.height, screenWidth, 40))
      buttonTwo.setTitle("Button Two", forState: .Normal)
      buttonTwo.setTitleColor(UIColor.blackColor(), forState: .Normal)
      buttonTwo.backgroundColor = UIColor.whiteColor()
      buttonTwo.addTarget(self, action: Selector("buttonTwoPressed"), forControlEvents: UIControlEvents.TouchUpInside)
      buttonTwo.userInteractionEnabled = true
      dropDownView.addSubview(buttonTwo)
  
  }
  
  func buttonTwoPressed(){
      self.performSegueWithIdentifier("showLocation", sender: self)
  }
  
  override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
      if (segue.identifier == "showLocation") {
          var location: LocationTableViewController = (segue.destinationViewController as? LocationTableViewController)!
  
      }
  }
  </code></pre>
  
  <p>Button click functions are not being called.</p>