NSLog(@"Here comes the magic...");
// First begin a transaction so that implicit animations happen simultaneously.
[LKTransaction begin];
NSLog(@"Begun LK transaction");
//[LKTransaction setValue:(id)kCFBooleanTrue forKey:@"disableActions"]; // Turns off implicit animations for this transaction
[LKTransaction setValue:[NSNumber numberWithFloat:0.25f] forKey:@"animationDuration"]; // Set the duration of the implicit animation
// Ideally we should implement a callback here for when this animation has completed
// Currently this animation can be interupted by another cover selection change.
// This results in the layers becoming misordered, and you end up with a less than perfect "flow"
//[LKTransaction setDelegate:self];
for (i = 0; i < count; i++)
{
//NSLog(@"Positioning sublayer %d", i);
sublayer = [array objectAtIndex:i];
....
sublayer.zPosition = zSidePosition - .1 * (x - selected);
sublayer.transform = rightTransform;
....
}
[LKTransaction commit];