I'm trying to initialize a CATransition instance, but xCode keeps telling me that I'm making an Use of undeclared identifier "CATransition". Did you mean "kCATransition"?
The line in question is quite simple:
CATransition* transition = [CATransition animation];
What am I doing wrong? I've found this code several times over the web, but I can't figure out what am I doing different.
EDIT: Ok, so I have imported Quartz like suggested
#import <QuartzCore/QuartzCore.h>
But now I get a different message in the next line of code: "Incompatible pointer to integer conversion sending 'NSString *const' to parameter of type 'NSCellType'"
CATransition* transition = [CATransition animation];
[transition setType:kCATransitionPush];
#import <QuartzCore/QuartzCore.h>
you definitely need to #import
and here is my example of CATransition :
- (IBAction)FavButtonPressed:(id)sender
{
FavoritesViewController *favVC = [self.storyboard instantiateViewControllerWithIdentifier:@"FavoritesViewController"];
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:favVC];
CATransition* transition = [CATransition animation];
transition.duration = 0.3;
transition.type = kCATransitionMoveIn;
transition.subtype = kCATransitionFromBottom;
[self.view.window.layer addAnimation:transition forKey:kCATransition];
[self presentViewController:nav animated:NO completion:nil];
}
what this does: transition occurs when I press the favorite button
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With