-
-
Save jasonsilberman/d906817162ea6f4ddcf6 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
@interface Window : UIWindow | |
@end |
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
#import <QuartzCore/QuartzCore.h> | |
#import "Window.h" | |
@implementation Window | |
- (void)layoutSubviews | |
{ | |
[super layoutSubviews]; | |
CGRect frame = [UIScreen mainScreen].applicationFrame; | |
UIBezierPath *innerPath = [UIBezierPath bezierPathWithRoundedRect:frame byRoundingCorners:UIRectCornerTopLeft|UIRectCornerTopRight cornerRadii:CGSizeMake(10.f, 10.f)]; | |
CAShapeLayer *maskLayer = [CAShapeLayer layer]; | |
maskLayer.path = innerPath.CGPath; | |
self.layer.mask = maskLayer; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment