Created
November 20, 2014 01:02
-
-
Save rodericj/7eec9de86255ec16b1cf to your computer and use it in GitHub Desktop.
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
CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init]; | |
CGRect maskRect = self.coneImageView.frame; | |
NSLog(@"Mask rect is %@", NSStringFromCGRect(maskRect)); | |
// Create a path with the rectangle in it. | |
CGPathRef path = CGPathCreateWithRect(maskRect, NULL); | |
// Set the path to the mask layer. | |
maskLayer.path = path; | |
// Release the path since it's not covered by ARC. | |
CGPathRelease(path); | |
// Set the mask of the view. | |
self.connectorLine.layer.mask = maskLayer; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment