title: UIKit Dynamics - slow moving objects won't bounce
body: <p>The goal is to create an environment where an image of a ball will bounce around endlessly inside a view <strong><em>very slowly</em></strong>.  I can make the endless bounce work with a high velocity, but not a slow velocity.  </p>
  
  <p>Here's a sample of the code:</p>
  
  <pre><code>UIDynamicAnimator  *animator = [[UIDynamicAnimator alloc] initWithReferenceView: self.view];
  
  UICollisionBehavior  *ballCollision = [[UICollisionBehavior alloc] initWithItems: @[largeBall, mediumBall, smallBall]];
  [ballCollision setTranslatesReferenceBoundsIntoBoundary: YES];
  [ballCollision setCollisionMode: UICollisionBehaviorModeBoundaries];
  
  float force = 0.1;
  int angle = 225;
  NSNumber *rad = [NSNumber numberWithDouble: DEGREES_TO_RADIANS(angle)];
  
  UIPushBehavior  *smallPush = [[UIPushBehavior alloc] initWithItems: @[smallBall] mode: UIPushBehaviorModeInstantaneous];
  [smallPush setAngle: [rad floatValue]];
  [smallPush setMagnitude: force];
  
  UIDynamicItemBehavior *dynamicBehavior = [[UIDynamicItemBehavior alloc] initWithItems: @[smallBall]];
  [dynamicBehavior setDensity: 0.0];
  [dynamicBehavior setElasticity: 1.0];
  [dynamicBehavior setFriction: 0.0];
  [dynamicBehavior setResistance: 0.0];
  
  [animator addBehavior: ballCollision];
  [animator addBehavior: smallPush];
  [animator addBehavior: dynamicBehavior];
  </code></pre>
  
  <p>My high school physics class must not have sunk in, because I can't figure out why this doesn't work.  Friction is zero, elasticity is one, the ball should bounce forever, shouldn't it?</p>