Skip to content

Instantly share code, notes, and snippets.

@nacho4d
Created March 27, 2012 06:10
Show Gist options
  • Save nacho4d/2213175 to your computer and use it in GitHub Desktop.
Save nacho4d/2213175 to your computer and use it in GitHub Desktop.
Adds a drop shadow effect to the view
// Adds a drop shadow to the view
#import <QuartzCore/QuartzCore.h>
@interface UIView (WMAdditions)
- (void)addDropShadow;
@end
@implementation UIView (Dropshadow)
- (void)addDropShadow
{
// Below 4 properties show the drop shadow
self.layer.shadowOpacity = 1.0;
self.layer.shadowRadius = 0.0;
self.layer.shadowColor = [UIColor blackColor].CGColor;
self.layer.shadowOffset = CGSizeMake(0, -1);
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment