I am developing an iphone app. It has following page structure, 1.List of game levels in a UITableView 2.Game page
I use "UIViewAnimationTransitionFlipFromRight" between pages
Game page has 3 views, One is a scrollView in that my game grid is drawn. Game grid is a sub class of UIView ,that added to Scrollview. To support zooming i use CATiledLayer to draw the grid(20*20).
MY problem is GameGrid shows white or last played puzzles grid contents for a few seconds and then refresh(flashing) to the new content.
My GameGrid class as follows
`
@implementation GameGrid
+(Class)layerClass
{
return [CATiledLayer class];
}
- (id)initWithFrame:(CGRect)frame {
if ((self = [super initWithFrame:frame])) {
CATiledLayer *tempTiledLayer = (CATiledLayer*)self.layer;
tempTiledLayer.levelsOfDetail = 5;
tempTiledLayer.levelsOfDetailBias = 2;
self.opaque=YES;
}
return self;
}
-(void)drawRect:(CGRect)r
{
//empty
}
-(void)drawLayer:(CALayer*)layer inContext:(CGContextRef)context
{
// here i am drawing grid
// filling rect
// lines
// string etc..
}