Skip to content

Instantly share code, notes, and snippets.

@jasonsilberman
Forked from isutton/MyWindow.h
Last active August 29, 2015 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasonsilberman/d906817162ea6f4ddcf6 to your computer and use it in GitHub Desktop.
Save jasonsilberman/d906817162ea6f4ddcf6 to your computer and use it in GitHub Desktop.
@interface Window : UIWindow
@end
#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