I am creating some CALayers and transforming them using CATransform3D using
imageLayer.frame = CGRectMake(-22.0f, 188.0f, 180.0f, 50.0f);
imageLayer.transform = CATransform3DMakeRotation(120.0f * M_PI / 180.0f,
0.0f, 15.0f, 0.0f);
imageLayer.contents = (id)[[UIImage imageNamed:@"photo.png"] CGImage];
[caLayer addSublayer:imageLayer];
here is an sample image with the output…

I have kept the untransformed image as image view so that i can handle swipes. I have an array of 10 images. So, when a user swipes on the main images the corresponding images should load up in the layers and image view. I can load the image view but had some problems loading the CALayers dynamically.
I have tried
NSArray *array=[caLayer sublayers];
caLayer = [array objectAtIndex:entryImageIndex];
//caLayer.contents=(id)[[UIImage imageNamed:@"flashImage1.jpg"] CGImage];
caLayer.contents=(id)[[UIImage imageWithCGImage:[imageArray objectAtIndex:entryImageIndex-1]]];
But this gave me errors. Can anyone plz tell me how to populate the CALayers dynamically with images…Any sample code will be of great help…
instead of
try
or