I want to create an animated popover bubble like the one below. With the same expanding/contracting bounce animation. Does anyone know how to go about this? Is is just a UIView with animation? What animation effect is this? Any pointers on how to go about this would be really appreciated. Thanks!
How do I create a bouncing popover animation like this?
3k views Asked by KexAri At
2
There are 2 answers
0
On
i think it is UIPopoverPresentationController. sample:
-(void)showPopover:(UIBarButtonItem*)sender{
if(!_btnController){
_btnController = [[ButtonsViewController alloc] init];
_btnController.delegate = self;
}
if (_popover == nil) {
_btnController.modalPresentationStyle = UIModalPresentationPopover;
UIPopoverPresentationController *pc = [ _btnController popoverPresentationController];
pc.barButtonItem = sender;
pc.permittedArrowDirections = UIPopoverArrowDirectionAny;
pc.delegate = self;
[self presentViewController: _btnController animated:YES completion:nil];
} else {
//The color picker popover is showing. Hide it.
[_popover dismissPopoverAnimated:YES];
_popover = nil;
}}
You can use the
Obj-C:
animateWithDuration:delay:usingSpringWithDamping:initialSpringVelocity:options:animations:animations completion:
method like this:Swift: