Draw a shadow to One View iOS objective C

Solution:

Draw a shadow under a view in iOS.

Code:

- (void)drawRect:(CGRect)rect {
    CGContextRef context = UIGraphicsGetCurrentContext();
    CGContextSaveGState(context);
    CGContextSetShadow(context, CGSizeMake(-14, 20), 5);
    [self.view drawRect: rect];
    CGContextRestoreGState(context);
}

Comments

Popular posts from this blog

Invalid bundle error while upload the app to the app Store

store cgpoint in userdefaults iOS swift