title: how to create a pop up view in Swift
body: <p>So I am trying to create a pop up view within an existing view: Whenever a button is pushed, the pop up view comes up </p>
  
  <p>this is the code I've used to when the button is pressed</p>
  
  <pre><code>@IBAction func addFees(sender: UIButton) {
      UIView.beginAnimations(nil, context: nil)
      UIView.setAnimationDuration(0.3)
      view2.frame = CGRectMake(0, 200, 320, 261)
      UIView.commitAnimations()
  }
  </code></pre>
  
  <p>this is the code I use to  make it go away</p>
  
  <pre><code>@IBAction func doneButton(sender: UIBarButtonItem) {
      UIView.beginAnimations(nil, context: nil)
      UIView.setAnimationDuration(0.3)
      listingfees.frame = CGRectMake(0, 1000, 320, 261)
      UIView.commitAnimations()
  }
  </code></pre>
  
  <p>The problem is that I have other buttons and labels and they seem to overlap when the view comes up.
  I don't know how to fix it. I am not sure if there is an easier away but I've been stuck on this problem for a while.</p>
  
  <p>I want it to look something like the picture on the right</p>
  
  <p><img src="https://i.stack.imgur.com/GbElW.jpg" alt="enter image description here"></p>