title: How to Hide an Element and Its Space in Swift
body: <p>I want to hide an element (data picker in my case) and also hide its space. So I tried this with an animation:</p>
  <pre><code>@IBAction func showQnt(sender: AnyObject) {
      if (self.pickerQnt.alpha == 0.0) {
          UIView.animateWithDuration(0.2, delay: 0.0, options: UIViewAnimationOptions.ShowHideTransitionViews, animations: {
              self.pickerQnt.alpha = 1.0
              
              
              }, completion: {
                  (finished: Bool) -&gt; Void in
                  //var constH = NSLayoutConstraint(item: self.pickerQnt, attribute: NSLayoutAttribute.Height, relatedBy: NSLayoutRelation.Equal, toItem: nil, attribute: NSLayoutAttribute.NotAnAttribute, multiplier: 1, constant: 162)
                  //self.pickerQnt.addConstraint(constH)
          })
      } else {
          UIView.animateWithDuration(0.2, delay: 0.0, options: UIViewAnimationOptions.ShowHideTransitionViews, animations: {
              self.pickerQnt.alpha = 0.0
              
              
              }, completion: {
              (finished: Bool) -&gt; Void in
                  // CHECK: ?!? constrain to set view height to 0 run time
                  //var constH = NSLayoutConstraint(item: self.pickerQnt, attribute: NSLayoutAttribute.Height, relatedBy: NSLayoutRelation.Equal, toItem: nil, attribute: NSLayoutAttribute.NotAnAttribute, multiplier: 1, constant: 0)
                  //self.pickerQnt.addConstraint(constH)
          })
      }
  }
  </code></pre>
  <p>I've also tried something like</p>
  <pre><code>self.pickerQnt.hidden = true
  </code></pre>
  <p>but it wont work.</p>
  <p>Thanks in advance.</p>