title: iOS 13 Alternative to 'setAnimationCurve'
body: <p>with iOS 13 Apple <strong>deprecated</strong> a lot of functions that I've been using in my app. For most of them, there are already alternatives well explained on StackOverflow - however not for '<strong>setAnimationCurve</strong>'.</p>
  
  <blockquote>
    <p><strong>'setAnimationCurve'</strong> was deprecated in iOS 13.0: Use the block-based
    animation API instead</p>
  </blockquote>
  
  <p><strong>This is the exact code I have:</strong></p>
  
  <pre><code>  // MARK: - Keyboard up/down adjustment for the addMediaBar
  
  @objc func keyboardWillShow(notification: NSNotification) {
  
      if let keyboardSize = (notification.userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as? NSValue)?.cgRectValue {
  
          let userInfo = notification.userInfo! as [AnyHashable: Any]
  
          let animationDuration = userInfo[UIResponder.keyboardAnimationDurationUserInfoKey] as! NSNumber
  
          let animationCurve = userInfo[UIResponder.keyboardAnimationCurveUserInfoKey] as! NSNumber
  
  
  
          if addMediaBarBottomAnchor.constant == 0 {
  
              let window = UIApplication.shared.windows.filter {$0.isKeyWindow}.first
  
  
  
              if let bottomPadding = window?.safeAreaInsets.bottom {
  
                  print(keyboardSize.height)
  
                  print(bottomPadding)
  
  
  
                  UIView.setAnimationCurve(UIView.AnimationCurve(rawValue: animationCurve.intValue)!)
  
                  UIView.animate(withDuration: animationDuration.doubleValue) {
  
                      self.addMediaBarBottomAnchor.constant = -keyboardSize.height + bottomPadding
  
                      self.view.layoutIfNeeded()
  
                  }
  
  
  
              } else {
  
                  UIView.setAnimationCurve(UIView.AnimationCurve(rawValue: animationCurve.intValue)!)
  
                  UIView.animate(withDuration: animationDuration.doubleValue) {
  
                      self.addMediaBarBottomAnchor.constant = -keyboardSize.height
  
                      self.view.layoutIfNeeded()
  
                  }
  
              }
  
  
  
          }
  
      }
  
  }
  </code></pre>
  
  <p>I am using this code to <em>slide up/down a bar</em> on the bottom of the screen, whenever the <em>keyboard shows up</em>.</p>
  
  <p><strong>I would be really grateful for any help on this topic.</strong></p>