func createAnimationView() -> UIView {
let animationView = UIView(frame: CGRect(x: 0, y: 0, width: UIScreen.main.bounds.width, height: 60))
animationView.backgroundColor = .red
UIView.animate(withDuration: 5, animations: {
animationView.transform = CGAffineTransform(translationX: -animationView.frame.width, y: 0)
}) { _ in
UIView.animate(withDuration: 5) {
animationView.transform = CGAffineTransform(translationX: animationView.frame.width, y: 0)
}
}
return animationView
}
This is not working as expected. first its sliding from right to left and disappearing from left to right.
I want it to be first slide from left to right. Can anyone please help here.
Thanks in Advance..