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
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
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.
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.