I want to create a rectangle shape on our view controller.
I tried it by using this code:
UIView *frameForView = [[UIView alloc] initWithFrame:CGRectMake(0,0,70,70)];
frameForView.backgroundColor=[UIColor greenColor];
I think the above code is correct but I don't understand that how can I fix it on our view controller.
Please tell me what's wrong in my code.
It is very simple to set the frame on to the view controller, your code is correct but it needed some other code to fix it.
Here I am providing complete code:
I hope it is helpful for you.