I am trying to move a UIView up and off the screen by its height in ios. Below is my code for doing this. What I am finding is that the UIView does indeed move up and off the screen but instead of moving slowly as intended it continues to move off instantaneously without animation. Please can someone advise?
UIView.animate(withDuration: 300, animations: {
let heightOfViewContainingProgrBar = self.viewContainingProgressBar.frame.height
self.viewContainingProgressBar.topAnchor.constraint(equalTo: self.view.topAnchor, constant: -heightOfViewContainingProgrBar).isActive = true
})