0

I'm experiencing that the drawRect method is called after the modalViewController has shown. Is it possible call the drawRect method before, so there won't be any delay?

Best regards Sebastian Søndergaard

2 Answers2

1

No, the drawRect method is called at the time of drawing. If your drawing code is doing too much however, you can pre-calculate it and put in in a CGLayerRef for example. Then your drawRect method can just paint the layer into the context.

mprivat
  • 21,582
  • 4
  • 54
  • 64
0

You can do calculations on a background thread (carefully), then send it back to the main thread and call setNeedsDisplay on the view, if your main thread is choppy.

Blake Caldwell
  • 311
  • 2
  • 8