EasyAnimation icon indicating copy to clipboard operation
EasyAnimation copied to clipboard

EasyAnimation breaks popover presentation animation

Open jbeachwood opened this issue 10 years ago • 13 comments

Adding EasyAnimation to a project breaks the presentation animation for a UIPopoverController, whether being used explicitly with UIViewController and a UIPopoverController, or implicitly by setting the modalPresentationStyle for a UIViewController to UIModalPresentationStylePopover and setting a sourceView and sourceRect. The popover still animates into place but various elements of the popover are out of place until they finish animating, and the dimmed out background view jumps up into place.

I have been able to consistently replicate this with EasyAnimation 0.7 + 1.0 with the following steps:

  • Create a new project and add EasyAnimation via CocoaPods. Open the new workspace.
  • Add a button to the storyboard for the default ViewController class.
  • Add a IBOutlet for a UIButton:
    @IBOutlet private weak var button: UIButton!
  • Add the following IBAction:
    @IBAction func buttonPressed(sender: UIButton) {
        let alertController = UIAlertController(title: "Test", message: "test", preferredStyle: UIAlertControllerStyle.ActionSheet)
        alertController.modalPresentationStyle = UIModalPresentationStyle.Popover
        alertController.popoverPresentationController?.sourceView = self.view
        alertController.popoverPresentationController?.sourceRect = self.button.frame
        self.presentViewController(alertController, animated: true, completion: nil)
    }
  • Connect the UIButton in the storyboard to the outlet and the action.
  • Run and tap on the button to observe the broken animation.

jbeachwood avatar Sep 25 '15 16:09 jbeachwood

hey that's an interesting find - I'll try to reproduce it here and fix it, thanks! Is there any kind of error message or a warning in the output console?

icanzilb avatar Sep 25 '15 16:09 icanzilb

No console output that could assist unfortunately. I tested it on the 8.3 Simulator with EasyAnimation 0.7 and on the 9.0 Simulator and a 9.0 Device with EasyAnimation 1.0 and I'm able to reproduce it on every platform.

jbeachwood avatar Sep 25 '15 16:09 jbeachwood

Any update on this issue? Were you able to replicate it?

jbeachwood avatar Oct 14 '15 18:10 jbeachwood

I did exactly what you described but didn't get a crash. Could you please provide a test project?

icanzilb avatar Oct 19 '15 20:10 icanzilb

Interesting that after my issue being dismissed- the only issue that remains open is exactly a case of what I was talking about:

https://github.com/icanzilb/EasyAnimation/issues/23

danielgindi avatar Dec 22 '15 13:12 danielgindi

We've had the same problem with popovers after adding Easy Animation, and have removed it for the time being.

I'm attaching a .mov of what we saw with popovers. It seems like popovers initially appear as a slightly-too-large rounded rect, while its mask appears offset to the side a little bit. As the popover rect resizes to its correct size, the mask animates into position.

popover-weirdness-edit.mov.zip

invalidname avatar Jan 25 '16 22:01 invalidname

I created a sample: https://github.com/JanGorman/EasyAnimationSample You'll see the popover acting all weird when you run the sample on an iPad (simulator).

For the time being we've also removed the library because of this. I traced it down to the EasyAnimation before seeing this issue by adding a symbolic breakpoint to layoutSubviews where I noticed calls to EA_animateWithDuration. As @danielgindi mentioned, this is the swizzled out method that replaces animateWithDuration.

JanGorman avatar Feb 23 '16 10:02 JanGorman

Thanks @JanGorman - looks like I'll have to look into this ...

icanzilb avatar Feb 24 '16 08:02 icanzilb

Still not fixed?

oxozle avatar May 24 '16 13:05 oxozle

You're welcome to send a PR

icanzilb avatar May 24 '16 13:05 icanzilb

I am getting an error in animation when I migrate my project to Swift 4.2 and iOS 12. However, my old code is running fine in iOS 12. I am using SwiftAnimation framework of version 2.0.2 My table view cells container view not adjusting its frame with respect to the parent view. Can anybody please help me with this. Thanks in advance.

AjayGirolkar avatar Oct 23 '18 11:10 AjayGirolkar

Can confirm this is still happening, iOS 12, iPad.

Shanlon avatar Jan 21 '19 21:01 Shanlon

Still happening, iOS 13

libern avatar Nov 22 '19 05:11 libern