user339946
user339946

Reputation: 6119

Accessing drawRect from ViewController?

I have a UIView subclass with a drawRect method. My viewController uses this subclass (I just set it in the xib), and so UIView draws a rectangle to the screen fine.

Now, I'd like to send a bunch CGRects stored in my viewController to my UIView drawRect method.

I'm unsure how to pass them. Any ideas? Thanks.

Upvotes: 1

Views: 653

Answers (1)

edc1591
edc1591

Reputation: 10182

You can add properties to your UIView subclass to store the CGRect's, set them from your UIViewController then call [self.view setNeedsDisplay]; from your UIViewController.

Upvotes: 2

Related Questions