I assume the problem is that changing the frame size leads to a change in the size of the notifications. With a reduction, there may be more interruptions as new areas of observation are identified.
In this case, the conversion method is much better.
I also assume that using the conversion method, paths and glyph layouts (line breaks, etc.) are not recalculated and cached. CGPath is simply converted during rendering.
About the problem of centering, I do not see any problems.
I would like to add that if you plan to widely use this effect, you can create a static class for this effect or containing several predefined animations with statically saved transformations inside.
Then you make such calls: [MyPopEffect popView: mylabel];
It avoids creating and releasing transformations and allows instant use of any kind or in other projects.
Anyway, here is the animation code ... Greetings
[
UIView animateWithDuration:0.5f delay: 0.0f options:UIViewAnimationOptionCurveEaseOut+UIViewAnimationOptionBeginFromCurrentState animations:^{ label.transform=CGAffineTransformMakeScale(2.0f,2.0f); } completion:^(BOOL finished){ [UIView animateWithDuration:0.5f delay: 0.0f options:UIViewAnimationOptionCurveEaseIn+UIViewAnimationOptionBeginFromCurrentState animations:^{ label.transform=CGAffineTransformMakeScale(1.0f,1.0f); } completion:^(BOOL finished){}]; }];
]
Moose source share