title: UIKit Dynamics: recognize rounded Shapes and Boundaries
body: <p>i am writing an App where i use UIKit Dynamics to simulate the interactions of different circles with one another.</p>
  
  <p>I create my circles with the following code:</p>
  
  <pre><code>self = [super initWithFrame:CGRectMake(location.x - radius/2.0, location.y - radius/2, radius, radius)];
  if (self) {
      [self.layer setCornerRadius: radius /2.0f];
      self.clipsToBounds = YES;
      self.layer.masksToBounds = YES;
      self.backgroundColor = color;
      self.userInteractionEnabled = NO;
  }
  return self;
  </code></pre>
  
  <p>where location represents the desired location of the circle, and radius its radius.</p>
  
  <p>I then add these circles to different UIBehaviours, by doing:</p>
  
  <pre><code>[_collision addItem:circle];
  [_gravity addItem:circle];
  [_itemBehaviour addItem:circle];
  </code></pre>
  
  <p>The itemBaviour is defined as follows:</p>
  
  <pre><code>_itemBehaviour = [[UIDynamicItemBehavior alloc] initWithItems:@[square]];
  _itemBehaviour.elasticity = 1;
  _itemBehaviour.friction = 0;
  _itemBehaviour.resistance = 0;
  _itemBehaviour.angularResistance = 0;
  _itemBehaviour.allowsRotation = NO;
  </code></pre>
  
  <p>The problem i am having, is that my circles are behaving as squares. When hit in certain ways they gain angular momentum and lose speed. If they collide again, sometimes the angular momentum is again reverted to speed. This looks normal for squares, but when the view is round, like in my case, this behaviour looks weird and unnatural.</p>
  
  <p>Turning on some debug options, i made this screenshot:
  <img src="https://i.stack.imgur.com/MEsCf.png" alt="small circle is actually a square"></p>
  
  <p>As you can see, the circle is appearently a square.</p>
  
  <p>So my question is, how can i create an UIVIew that is truly a circle and will behave as such in UIKit Dynamics?</p>