Hello, I would like to have a category for UIViewController containing few simple methods to move the view controller's view around, fading it etc...
For example the method below fades in/out a the VC's view. I'm not using instance variables and the onTransitionIn: method is called, the problem is the view doesn't fade in/out.
Can someone tell me what I'm doing wrong?
Thank you!
EXAMPLE:
@implementation UIViewController (UIViewControllerAdditions)
- (void)onTransitionIn:(BOOL)isIn {
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:ANIM_DUR];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
[UIView setAnimationDelegate:self];
int newAlpha = 1;
if (!isIn) {
newAlpha = 0;
[UIView setAnimationDidStopSelector:@selector(hideAnimationDidStop)];
}
// set the new alpha
self.view.alpha = newAlpha;
[UIView commitAnimations];
}