UIDynamics - The gotcha!

Make sure you remove all behaviours before directly manipulating a View.

I've been using the iOS 7 framework in a little app I've been writing this week and I was having problems which turned out to be because I wasn't removing all the behaviours from the View before directly transforming it (while it was being dragged).

This includes behaviours that you wouldn't expect to be affected such as UIAttachment anchors pinning the centre of the View to the point which the direct transformation was rotating it. As soon as the dynamic behaviour wants to update the view it will put it where it thinks it should be ignoring all your transformations. Basically (probably for valid performance reasons) the UIDynamics ONLY reads the view's properties when behaviors are added to the view.

It would be nice if there was a call that you could make (either to behaviours or to the UIDynamicAnimator) to inform it of updates to a view so that it could refresh rather than tearing everything down and setting it up again, maybe iOS 8.