Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I know when a CATiledLayer has rendered all visible tiles?

I am working on an application where I render PDF content in a CATiledLayer. I want to trigger one method after the rendering of the tiled layer is complete.

Is there any delegate method that will be called immediately after the rendering of all visible tiles is completed? Is there any other way of knowing when this is finished?

like image 487
Hariprasad Avatar asked Feb 22 '11 15:02

Hariprasad


1 Answers

You can calculate the number of tiles your drawing requires before it's drawn. In drawRect of the tilingview, each tile is drawn only ONCE. So put a counter in part of the draw rect that calls a new tile. When your counter reaches the total number, call your method.

Keep in mind that drawrect for tiling is done on a background thread.

like image 97
ssj Avatar answered Oct 23 '22 18:10

ssj