i've created a view with an header and a container... inside the container there is a page view controller
the header resize based on the container, throught an iboutlet constraint
if there is a table view as page in the container then the header resize based on the scroll offset, without animation
if i scroll between pages i want the header to be resized, so i've created a delegate method that listen the end of the scroll animation and then resize the header
but if i animate this resizing with this code
UIView.animate(withDuration: 0.5,animations: {
self.imageViewHeightConstraint.constant = ct
self.view.layoutIfNeeded()
}, completion: {
_ in
if let handler = handler {
handler()
}
})
then the pages are "reloaded" after the resizing it's complete
this is a video of the animation ( the red background is the background of the page view controller that i've edited for debug reason)