UIBezierPath

From iPhone Development Wiki
Revision as of 17:46, 4 October 2009 by KennyTM~ (talk | contribs)


UIBezierPath is a convenient object for creating rounded-rectangular shapes.

Example

-(void)drawRect:(CGRect)rect {
  UIBezierPath* roundedRect = [UIBezierPath roundedRectBezierPath:CGRectInset(rect, 5, 5)
                                               withRoundedCorners:UIBezierPathRoundedTopLeftCorner|UIBezierPathRoundedTopRightCorner|UIBezierPathRoundedBottomLeftCorner|UIBezierPathRoundedBottomRightCorner
                                                 withCornerRadius:5];
  [[UIColor blackColor] setFill];
  [roundedRect fill];
}

Reference