title: Create a PopUp in Swift using a custom UIView
body: <p>I am trying to create a custom <code>UIView</code> and display it as a pop up in my main View using Swift.</p>
  
  <p>My Custom <code>UIView</code> code is </p>
  
  <pre><code>class DatePopUpView: UIView {
  var uiView:UIView?
  
  override init()  {
      super.init()
      self.uiView = NSBundle.mainBundle().loadNibNamed("DatePopUpView", owner: self, options: nil)[0] as? UIView
  
  }
  
  required init(coder aDecoder: NSCoder) {
      super.init(coder: aDecoder)
        }
  
  required override init(frame: CGRect) {
             super.init(frame: frame)
  
  }
  
  }
  </code></pre>
  
  <p>And I am Calling it in my main view as:</p>
  
  <pre><code> @IBAction func date_button_pressed (sender : AnyObject?) {
   var popUpView = DatePopUpView()
   var centre : CGPoint = CGPoint(x: self.view.center.x, y: self.view.center.y)
  
      popUpView.center = centre
      popUpView.layer.cornerRadius = 10.0
    let trans = CGAffineTransformScale(popUpView.transform, 0.01, 0.01)
      popUpView.transform = trans
      self.view .addSubview(popUpView)
      UIView .animateWithDuration(0.5, delay: 0.0, options:     UIViewAnimationOptions.CurveEaseInOut, animations: {
  
          popUpView.transform = CGAffineTransformScale(popUpView.transform, 100.0, 100.0)
  
          }, completion: {
              (value: Bool) in
  
      })
  
   }
  </code></pre>
  
  <p>But popUp is not Coming. I used breakpoint and noticed that value is getting assigned to my popUpView but still it is not displayed on my main View. Please Help </p>
  
  <p>Please Note: I am using StoryBoard for my mainView and custom View i have made using xib.<img src="https://i.stack.imgur.com/cUkfT.png" alt=""></p>