HeroTransitions / HeroTransitions/Hero

Dismissing Modal with Hero disabled causes black screen

Open
#656 2 comments 0 reactions 1 assignee Claimed by @JoeMatt View on GitHub
Dominant language
Swift
Stars
22.5k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

Description

@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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.