Animation inside CollectionView Cell not running

I have button inside a CollectionViewCell and when tapped I want to run an animation. The animation doesn't run and I'm not sure why.

Inside the Cell class

@IBAction func hoursExpandBtnTapped(_ sender: Any) {

    UIView.animate(withDuration: 3, delay: 0, options: .curveLinear) { [self] in

    addressLbl.frame = CGRect(x: addressLbl.frame.minX, y: addressLbl.frame.minY, width: 20, height: addressLbl.frame.height)

            } completion: { _ in

            }

    }

Have you defined constraints for addressLbl ?

If so, you should change the constraints constant in the animation, not the frame.

You could also add a log to check what's going on and if animation lasts 3 seconds:

@IBAction func hoursExpandBtnTapped(_ sender: Any) {

    print("Started at", DispatchTime.now)
    UIView.animate(withDuration: 3, delay: 0, options: .curveLinear) { [self] in
        addressLbl.frame = CGRect(x: addressLbl.frame.minX, y: addressLbl.frame.minY, width: 20, height: addressLbl.frame.height)
            } completion: { _ in
                 print("Completed at", DispatchTime.now)
            }

    }

Animation inside CollectionView Cell not running
 
 
Q