title: iOS animation works perfect on iOS version 11.0 and above but the something is going wrong on iOS version below 11.0
body: <p>Here, I attached code created by me to do animations, </p>
  
  <pre><code>class GIFView: UIView  {
  
      @IBOutlet  var firstViewHeight: NSLayoutConstraint!
      @IBOutlet  var secondView: UIView!
      @IBOutlet  var firstView: UIView!
  
      var objLabel:LabelView?
  
      override func draw(_ rect: CGRect) {
          super.draw(rect)
      }
  
      func gifDemo(name:String) {
          let animation = LOTAnimationView(name: name)
          secondView.contentMode = .scaleAspectFit
          animation.frame.size.width = secondView.frame.size.width
          animation.frame.size.height = secondView.frame.size.height
          secondView.addSubview(animation)
          animation.play()
      }
  
      func preparelbl(name:String,points:String){
          registerXIB()
          objLabel?.prepareLabels(name: name, points: points)
      }
  
      func registerXIB() {
          let nib = UINib.init(nibName: "LabelView", bundle: nil)
          objLabel = nib.instantiate(withOwner: nil, options: nil)[0] as? LabelView
          objLabel?.frame = CGRect.init(x: 0, y: 0, width: firstView.bounds.size.width , height: firstView.bounds.size.height)
          firstView.addSubview(objLabel!)
      }
  
      func animation(view:UIView) {
  
          UIView.animate(withDuration: 5, animations: {
  
              self.firstView.alpha = 1.0
              self.secondView.alpha = 0.0
  
  
          }) { (isTrue) in
              self.secondView.isHidden = true
              self.animationFirstView(view:view)
          }
  
      }
  
      func animationFirstView(view:UIView) {
              self.commonAnimation(duration:0.5,delay:0.0)
  
              DispatchQueue.main.asyncAfter(deadline: .now() + .seconds(1), execute: {
                  while self.firstViewHeight.multiplier &gt; 0 {
                       self.animationWithCompletion(duration:0.3,delay:0.0,view:view)
  
                  }
              })
      }
  
      func commonAnimation(duration:Double,delay:Double){
          UIView.animate(withDuration:duration, delay: delay , options: [], animations: {
               let mult = self.firstViewHeight.multiplier - 0.5
              self.firstViewHeight = self.firstViewHeight.changeMultiplier(multiplier: mult)
              self.firstView.layer.cornerRadius = self.frame.height * mult / 2
              self.firstView.layoutIfNeeded()  
          })
      }
  
      func animationWithCompletion(duration:Double,delay:Double,view:UIView){
          UIView.animate(withDuration:duration, delay: delay , options: [], animations: {
                   let mult = self.firstViewHeight.multiplier - 0.01
                  self.firstViewHeight = self.firstViewHeight.changeMultiplier(multiplier: mult)
                  self.firstView.layer.cornerRadius = self.frame.height * mult / 2
                  //self.firstView.clipsToBounds = true
                  self.firstView.layoutIfNeeded()
  
  
  
          }) { (isTrue) in
              view.isHidden = true
          }
      }
  }
  
  
  public extension NSLayoutConstraint {
  
      func changeMultiplier(multiplier: CGFloat) -&gt; NSLayoutConstraint {
          NSLayoutConstraint.deactivate([self])
          let newConstraint = NSLayoutConstraint(
              item: firstItem,
              attribute: firstAttribute,
              relatedBy: relation,
              toItem: secondItem,
              attribute: secondAttribute,
              multiplier: multiplier,
              constant: constant)
          newConstraint.priority = priority
  
          NSLayoutConstraint.activate([newConstraint])
          return newConstraint
      }
  }
  </code></pre>
  
  <p>The above code run perfect on iOS version 11.0 and above but something is going wrong on iOS version below 11.0 which i don't understand if anyone know the solution then please give me the suggestion to fix it 
  Thank You.</p>