title: How to animate expand / collapse UIView
body: <p>I'm building a tinder-like app, and I'm using a library KolodaView: <a href="https://github.com/Yalantis/Koloda" rel="nofollow noreferrer">https://github.com/Yalantis/Koloda</a></p>
  
  <p>In the library they have functionality setup so when you tab the UIView it triggers an action. At the moment its setup to open up a URL. As seen below:</p>
  
  <pre><code>extension ViewController: KolodaViewDelegate {
  
  func kolodaDidRunOutOfCards(_ koloda: KolodaView) {
      print("Out of cards")
  }
  
  func koloda(_ koloda: KolodaView, didSelectCardAt index: Int) {
      UIApplication.shared.openURL(URL(string: "https://yalantis.com/")!)
  }
  
  func koloda(_ koloda: KolodaView, didSwipeCardAt index: Int, in direction: SwipeResultDirection) {
  
      let x = data[index]
      print("did swipe \(x) in diredtion: \(direction)")
  }
  
  }
  </code></pre>
  
  <p>How can I set this up so that when you tap on the UIView it expands / collapses and therefore showing more information. Basically working like an accordion. Preferably the information that is shown from the expanding UIView would come from XIB file view.</p>
  
  <p>I already have the main UIView setup in my datasource from another XIB file view. </p>
  
  <pre><code> extension ViewController: KolodaViewDataSource {
  
  func kolodaNumberOfCards(_ koloda: KolodaView) -&gt; Int {
      return data.count
  }
  
  func koloda(_ koloda: KolodaView, viewForCardAt index: Int) -&gt; UIView {
  
      let swipeView = Bundle.main.loadNibNamed("SwipeView", owner: self, options: nil)![0] as! SwipeView
      let x = data[index]
  
      //        swipeView.setupView(job: x)
  
  
      return swipeView
  }
  
  func kolodaSpeedThatCardShouldDrag(_ koloda: KolodaView) -&gt; DragSpeed {
      return .default
  }
  
  }
  </code></pre>
  
  <p>I am quite new to swift and any help would greatly appreciated. </p>