First import #import <QuartzCore/QuartzCore.h> into your ViewController class.
Here is how I set my view in code
UIView *view1=[[UIView alloc]init];
view1.backgroundColor=[UIColor colorWithRed:255/255.0 green:193/255.0 blue:72/255.0 alpha:1.0];
CGRect view1Frame = view1.frame;
view1Frame....