Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

erdinc27

macrumors regular
Original poster
Jul 20, 2011
168
1
I want to create a genie effect for a view. Actually not exactly genie effect like in MacOS i want something similar. I want a view to transform and change the position at the same time. How i would do such effect ?

I did something like that but it doesn' t give the intended effect ?

Code:
- (void) animateTheView:(UIView *) paramView {
    
    CATransition *transition = [CATransition animation];
    transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear];
    transition.duration = 1.0f;
    transition.type = @"suckEffect";
    transition.subtype = @"fromBottom";
    [UIView setAnimationTransition:(int)transition forView:paramView cache:NO];
    [UIView setAnimationDuration:1.0f];
    [[paramView layer] addAnimation:transition forKey:nil];
    [UIView commitAnimations];
}
 
If you are looking to create something similar to a genie effect you will have to do 2 things at once.
1) Animate the position along a UIBezerPath
2) Animate the transform of the view.

With these things it's a case of trial and error until you are happy with the effect. Depending on the desired end result you may have to perform several animation steps in order to achieve the right effect.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.