There are several ways to do this. If you want to use the standard โSuckโ effect, you should see this answer (or this one ). However, both of these answers use the setAnimationPosition method for UIView, which is a private method, and you will receive a rejected application from the App Store (possibly not the desired result).
You can only use animation, keeping the default animation position of 0.0 (Suck in the upper left corner) with this code:
[UIView beginAnimations:@"suckEffect" context:nil]; [UIView setAnimationTransition:(UIViewAnimationTransition)103 forView:self.view cache:NO]; [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut]; [UIView setAnimationDuration:kAnimationDuration];
Finally, while good programmers could write it themselves ... great programmers will notice that it is already done and steal it :)
https://github.com/Ciechan/BCGenieEffect is an open source project to do just that.
source share