I have the following code in Swift. The problem is when it is executed, it performs the animation, but the window stays in its original position as shown in the gif I attached.
UIView.animateKeyframes(withDuration: 0.5, delay: 0, options: .calculationModePaced, animations: {
self.view.viewWithTag(123)?.frame = CGRect(x: screenWidth5/2, y: screenHeight, width: screenWidth5 * 4, height: screenHeight5 * 3 )
}, completion: .none)
self.view.viewWithTag(123)?.removeFromSuperview()
Thank you for your time and answers.
You need to put
removeFromSuperviewin your completion handler.