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

Saved Image in document directory and save path in coredata not able to fetch the image file iOS swift