SWApplicationSupport
SWApplicationSupport is an Objective-C framework that is used internally at Orion Transfer for developing Objective-C applications.
Example
There are several drawing related additions including the ability to round the corners of a polygon defined by a series of points:
#import "NSBezierPath+SWRoundedShape.h"
// This function draws a group of points with a bezier outline with a "rounded-rect" style.
- (void) drawGroup:(GPointSet*)group color:(NSColor*)color {
NSSize unitSize = [self scaledSize];
NSArray * outline = [group calculateOutline];
NSMutableArray * scaledOutline = [NSMutableArray new];
for (NSValue * value in outline) {
[scaledOutline addObject:[NSValue valueWithPoint:scalePoint([value pointValue], unitSize)]];
}
NSBezierPath * selection = [NSBezierPath roundedBezierPathWithPoints:scaledOutline radius:0.5];
[selection setLineWidth:unitSize.width / 18.0];
[selection setLineCapStyle:NSSquareLineCapStyle];
[[color colorWithAlphaComponent:0.22] setFill];
[selection fill];
[[color colorWithAlphaComponent:0.65] setStroke];
[selection stroke];
}
Follow Me