Users Pricing

forum

home / developersection / forums / how to create rectangle on uiview in ios?

How to create rectangle on UIView in iOS?

Anonymous User 2041 20 Jan 2016

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.


I am a content writter !


1 Answers

Tarun Kumar 20 Jan 2016 Accepted Answer