I have MyViewController class which is subclass of UIViewController.
I want to draw filled rectagle on it’s view.
Do I have to create a new view, set it’s background color and addSubview?
What is the simplest way?
I have MyViewController class which is subclass of UIViewController. I want to draw filled
Share
If you want a custom sized rectangle… yea pretty much what you described is the easiest.
Other possibilities exist though. You can go down into drawing stuff with like Quartz2D and what not. You could also make it so that when you draw the rect of the view, you draw a custom rectangle.
If you just want the entire view’s background color set to a color: