Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EasyAnimation breaks popover presentation animation #14

Open
jbeachwood opened this issue Sep 25, 2015 · 13 comments
Open

EasyAnimation breaks popover presentation animation #14

jbeachwood opened this issue Sep 25, 2015 · 13 comments

Comments

@jbeachwood
Copy link

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.
@icanzilb
Copy link
Owner

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?

@jbeachwood
Copy link
Author

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
Copy link
Author

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

@icanzilb
Copy link
Owner

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

@danielgindi
Copy link

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

#23

@invalidname
Copy link

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

@JanGorman
Copy link

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.

@icanzilb
Copy link
Owner

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

@oxozle
Copy link

oxozle commented May 24, 2016

Still not fixed?

@icanzilb
Copy link
Owner

You're welcome to send a PR

@AjayGirolkar
Copy link

AjayGirolkar commented Oct 23, 2018

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.

@Shanlon
Copy link

Shanlon commented Jan 21, 2019

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

@libern
Copy link

libern commented Nov 22, 2019

Still happening, iOS 13

libern added a commit to libern/awesome-swift that referenced this issue Nov 22, 2019
As a guide for people afterwards, I am facing this issue: icanzilb/EasyAnimation#14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants