I am wondering why when the arrow button is located in a different spot (by clicking on a Move Here button), it is popped back up to the top when the HUD is presented.
@nbonatsakis Can you please help with this when you get a chance? Thank you - much appreciated! :]
Sorry for the delayed response. The reason this happens is because of auto-layout. When you animated views, if the views are constrained via auto-layout constraints, they will revert to the initial state in certain situations (in this case when a new subview is added to the containing view).
One way to work around this in this case, is to go into Main.storyboard and delete the constrains on the Moving Button (with and height) as well as the two constraints that pin it to the superview. Once you do this, it will start in the same place but animations should survive anything hat happens.
In a “real” app, if you actually needed the view to be constrained, the way you’d have to deal with this is by actually changing the constants on the constraints and then calling layoutIfNeeded
inside an animation block.
Hope that helps
This tutorial is more than six months old so questions are no longer supported at the moment for it. Thank you!