The easiest way is to call CGContextSetShadow in drawRect: before drawing images.
- (void)drawRect:(CGRect)invalidRect { CGContextRef c = UIGraphicsGetCurrentContext(); CGContextSetShadow(c, CGSizeMake(5.0f, 5.0f), 5.0f); [myImage drawAtPoint:CGPointMake(50.0f, 50.0f)]; }
source share