How to give your views rounded edges

This is a pretty neat way to give your views rounded edges instead of having to do this using images, and all it requires is a simple line of code.

1
view.layer.cornerRadius = 10;

This is done using the QuartzCore framework so first you have to add it to your project frameworks, and also import this header file to your code:

1
#import <QuartzCore/QuartzCore.h>

Rounded edges for iPhone views