3
// Begin Animation "suckEffect".
CATransition* animation  = [CATransition animation];
animation.type           = @"suckEffect";
animation.duration       = 1.0f;
animation.timingFunction =  UIViewAnimationCurveEaseInOut;
myView.opaque            = 1.0f;
[myView.layer addAnimation:animation forKey:@"transitionViewAnimation"];

How you can see I write a part of code witch make an animated when I press delete button. When I press delete button in my application the "suckEffect" take place. But it goes to left corner of the screen. I want to ask you if anybody know how can I do this effect but for left corner of my iphone screen !!!

Viktor Apoyan
  • 10,655
  • 22
  • 85
  • 147

2 Answers2

6

You can use the undocumented +[UIView setAnimationPosition:]. Beware that the suckEffect is undocumented and Apple will reject apps using it. Same for setAnimationPosition:.

DarkDust
  • 90,870
  • 19
  • 190
  • 224
  • 4
    Declare it in a dummy category. `@interface UIView(IWantToGetRejected) ; + (void) setAnimationPosition:(CGPoint)p ; @end` – DarkDust Mar 11 '11 at 12:58
  • 2
    Understanding why the compiler is warning you and being okay that it's warning you about that is a GOOD thing. I like that you're not just ignoring it, but in this case, it's okay. You can do like @DarkDust says and shush the compiler, or you can just let it keep warning you about that because this particular warning is harmless. Do note, though, that your app won't be accepted in the store if you use this method. – Dan Ray Mar 11 '11 at 13:24
  • Can you upload the sample code how to use it ? I have same question:http://stackoverflow.com/questions/8352334/ios-catransition-suckeffect thank you – Webber Lai Dec 02 '11 at 09:09
5

If you don't want to violate apple store rules, you could use a third party library to do the effect, for instance:

https://github.com/Ciechan/BCGenieEffect

BadPirate
  • 25,802
  • 10
  • 92
  • 123