Question

I tried invoking UIGraphicsGetCurrentContext() in other places other than in drawRect. It give me a NULL. Is it true that I can can only get current context in UIView's drawRect: only?

Was it helpful?

Solution

Yes, outside of drawRect, the default context is nil. Before drawRect is called, a view will push its context onto the stack, and pop it after drawRect ends.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top