EasyAnimation breaks popover presentation animation
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.
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?
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.
Any update on this issue? Were you able to replicate it?
I did exactly what you described but didn't get a crash. Could you please provide a test project?
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
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.
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.
Thanks @JanGorman - looks like I'll have to look into this ...
Still not fixed?
You're welcome to send a PR
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.
Can confirm this is still happening, iOS 12, iPad.
Still happening, iOS 13