-
-
Save vitalybaev/a3af0f4f784375619f4c to your computer and use it in GitHub Desktop.
ASDisplayNode draw shadow & border
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
override class func drawRect( | |
bounds: CGRect, | |
withParameters parameters: NSObjectProtocol!, | |
isCancelled isCancelledBlock: asdisplaynode_iscancelled_block_t!, | |
isRasterizing: Bool) { | |
let context = UIGraphicsGetCurrentContext() | |
CGContextSaveGState(context) | |
CGContextSetShadowWithColor(context, CGSize (width: 0, height: 1), 10, UIColor.TitleColor().CGColor) | |
super.drawRect( | |
bounds, | |
withParameters: parameters, | |
isCancelled: isCancelledBlock, | |
isRasterizing: isRasterizing) | |
let path = UIBezierPath (roundedRect: bounds, cornerRadius: 5) | |
UIColor.redColor().setStroke() | |
path.stroke() | |
CGContextRestoreGState(context) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment