I have set a UIView in my storyboard and make it an outlet.
UIView
storyboard
@property (nonatomic, weak) IBOutlet UIView *testView;
You might enabled the autolayout in your project , if so the setFrame straightly won't work . Check here for more info
setFrame
Solution :