, , UIKit Dynamics iOS 7. , , UIDynamicItem (UIView does). , , bounds, CGRect. .
Bezier , , , , . DynamicsCatalog Xcode, , .
BumperView, UIView.
BumperView.m drawRect:
#define LINE_WIDTH 2.0
- (void)drawRect:(CGRect)rect
{
UIBezierPath *ovalPath = [UIBezierPath bezierPathWithOvalInRect:CGRectInset(self.bounds, LINE_WIDTH/2, LINE_WIDTH/2)];
[[UIColor blueColor] setStroke];
[[UIColor lightGrayColor] setFill];
ovalPath.lineWidth = LINE_WIDTH;
[ovalPath stroke];
[ovalPath fill];
}
BumperView .
bumper APLItemPropertiesViewController.m, BumperView.
viewDidAppear : collisionBehavior:
UIBezierPath *bumperPath = [UIBezierPath bezierPathWithOvalInRect:self.bumper.frame];
[collisionBehavior addBoundaryWithIdentifier:@"Bumper" forPath:bumperPath];
" ", , .