How can I use drawing method from StyleKit with my subclass of NSView/UIView?

How can I use drawing method from StyleKit with my subclass of NSView/UIView?

You have to override drawRect(_:) (Objective-C drawRect:) method and call your drawing code:

// Swift
override func draw(_ dirtyRect: NSRect) {
    StyleKit.drawBlueRect()
}
// Objective-C
- (void)drawRect: (CGRect)rect
{	
	[StyleKit drawBlueRect];
}

Please, check out the example project and EXBasicViewOne subclass of UIView.