How can I tell when a UIDynamicAnimator is at rest?

The animator has a property "running" that tells you when the animator is at rest.

The views associated with an animator’s behaviors can change position or change transform only when the animator is running. For optimization purposes, iOS can pause and then restart an animator. Use this method if you need to check whether or not your views are currently subject to changes in position or transform.


After some more poking around, it seems that the UIDynamicAnimatorDelegate does this - the - (void)dynamicAnimatorDidPause:(UIDynamicAnimator *)animator method seems to be called when the system is at a rest state.

self.animator = [[UIDynamicAnimator alloc] initWithReferenceView:self];
self.animator.delegate = self;

and

#pragma mark - UIDynamicAnimator Delegate
- (void)dynamicAnimatorDidPause:(UIDynamicAnimator *)animator
{
    NSLog(@"pause");
}

- (void)dynamicAnimatorWillResume:(UIDynamicAnimator *)animator
{
    NSLog(@"resume");
}

seem to work - resume is logged when the animation starts, and pause is logged within a second of the animation stopped.

Additionally, the running property on the UIDynamicAnimator itself seems to mirror the calls to the delegate methods - it's 1 when willResume is called, and it's 0 when didPause is called.