Reputation: 29
I drew a circle in UIView
with a help of UIBezierPath
. Then I added gravity behavior to that view using UIGravityBehavior
and collision behavior using UICollisionBehavior
. When the circle collides with other objects this view bumps as square, but I want to work with this view in collisions as with a circle. How can I do it?
Upvotes: 0
Views: 655
Reputation: 8148
You can’t use UIKit Dynamics to simulate a circle. It works with rectangular bodies only. You can add collision paths, but I think that is only for the reference frame. I recommend looking at SpriteKit’s SKPhysicsBody
. Unfortunately, I haven’t used it, so I can’t provide a code sample.
Upvotes: 1