The following code to move the header using layer animation works but I have a question regarding the code below. Why is the view.bounds.size.width divided by 2? I tried to used different numbers and it didn’t make a difference.
let flyRight = CABasicAnimation(keyPath: “position.x”)
flyRight.fromValue = -view.bounds.size.width/2
flyRight.toValue = view.bounds.size.width/2
flyRight.duration = 0.5