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

Dismissing Modal with Hero disabled causes black screen #656

Open
otymartin opened this issue Jan 2, 2020 · 2 comments
Open

Dismissing Modal with Hero disabled causes black screen #656

otymartin opened this issue Jan 2, 2020 · 2 comments
Assignees

Comments

@otymartin
Copy link

@JoeMatt

What did you do?

I present a modal with vc.modalPresentationStyle = .overCurrentContext
The presentingVC is a chat app VC with a list of chats. The chatCell's have a titleLabel who's heroId is the same as the Modal VC's navigationBar titleLabel.

The presentation animation works beautifully there's no problem here.

What did you expect to happen?

When I dismiss, I don't want the same match animation that was used to present the modal. Instead I want it to dismiss normally with the default iOS modal dismiss animation.

To achieve this, I set hero.isEnabled = false in my modal VC right before calling dismiss(animated: true..)

What happened instead?

Instead what happens is the modal will dismiss, I briefly see the my presenting VC with the cell that was tapped having it's subviews out of position. Then the view goes black. I debug the view hierarchy and it appears as if even my root viewController is dismissed so there's literally no rootVC in my viewhierachy.

How do I fix this to have a normal dismiss without Hero match animation?

General Information

  • Hero Version: 1.5.0

  • iOS Version(s): 11

  • Swift Version: 5

  • Devices/Simulators: Device

Demo Project

@otymartin
Copy link
Author

I temporary fixed this issue by renabling hero when dismissing and setting hero.modalAnimationType = .uncover(direction: .down)
It actually works better than if I used the normal dismiss animation.

My only issue now is the hero dismiss animation adds a dark shadow on the modal when dismissing which looks like a black line when the VC is dismissing.

I want to get rid of it entirely so it stays white. How do I do that?

FullSizeRender

@JoeMatt JoeMatt self-assigned this Jan 3, 2020
@glennposadas
Copy link

This is happening as of 2/17/21. :D

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

3 participants