I'm getting problem with this app, I'm doing an animations app using tableview. All the app is working properly when I'm scrolling the images are flipping but when I'm opening app the images are not flipping, please help me this is my first app? when i do scrolling the image flipping but i need to flip a image without doing any action(like scrolling/draging/touching on screen). i need to show the image flipping directly on the simulator when will i run code but i'm not getting that exactly
this is the code i'm trying to do in .h file - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath { CATransform3D rotation = CATransform3DMakeRotation( (90.0*M_PI)/180, .0, 0.5, 0.5); cell.contentView.layer.transform = rotation;
CGFloat rotationAngleDegrees = 360;
CGFloat rotationAngleRadians = rotationAngleDegrees * (M_PI/360);
//CGPoint offsetPositioning = CGPointMake(200, 20);
CATransform3D transform = CATransform3DIdentity;
transform = CATransform3DRotate(transform, rotationAngleRadians, 0.0, 1.0, 0.0);
// transform = CATransform3DTranslate(transform, offsetPositioning.x, offsetPositioning.y, 0.0);
UIView *card = [cell contentView];
card.layer.transform = transform;
card.layer.opacity = 0.8;
[UIView animateWithDuration:1.0 animations:^{card.layer.transform = CATransform3DIdentity;
card.layer.opacity = 1;}];
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
// Return the number of sections.
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
// Return the number of rows in the section.
return 100;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"RoyCard";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil)
{
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
cellImg=(UIImage *)[cell viewWithTag:101];
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.7f];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:cellImg cache:NO];
// [cell removeFromSuperview];
[UIView commitAnimations];
}
[UIView animateWithDuration:1.0 animations:^{tableView.layer.transform = CATransform3DIdentity;
tableView.layer.opacity = 1;}];
return cell;
}