Hero: iOS 13, Page Sheet modal controller incorrect display.

What did you do?

I add Hero library to my project, set isHeroEnabled on ViewControllers and set HeroID on views. Add new modal controller with Page sheet.

What did you expect to happen?

I expect to happen views modification and transform on transition. In iOS 11-12 - all OK. And I expect to happen in iOS 13, that I can see my modal view controller with default ios 13 dismiss swipe, top rounded and over previos view controller. Something like this: https://prnt.sc/patp70

What happened instead?

But in iOS 13, I happened this: https://prnt.sc/pato7j And swipe down for dismiss dont work. This problem fixed, if I change presentation style to Full screen. But I want Page sheet presentation style. How I can fix this?

General Information

  • Hero Version: 1.4.0

  • iOS Version(s): iOS 13.0

  • Swift Version: 5.0

  • Devices/Simulators: Simulator iPhone 11

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 12
  • Comments: 16

Most upvoted comments

Any progress on this topic? We also have problems working with modal view controllers. Is support for .pageSheet and .formSheet planned at all?

remove transitioning delegate just after enabling hero, that’s worked for me

navigationController.hero.isEnabled = true
navigationController.transitioningDelegate = nil

Set your view controller’s presentation style to “.fullScreen”

Forgot about that, thanks a lot, it helped 👍

+1, the same for me, strange black bar at the top of the screen, but I’m using present(controller, animated: true, completion: nil) with hero enabled.

This is probably because your view controller presentation style is set to “.automatic”, “.pageSheet”, or “.formSheet”. These presentation styles changed with the transition to iOS 13 and Hero is not yet optimized to handle them. Set your view controller’s presentation style to “.fullScreen” in order to present it as you did in iOS 12 and earlier.

remove transitioning delegate just after enabling hero, that’s worked for me

navigationController.hero.isEnabled = true
navigationController.transitioningDelegate = nil

Does this work around work for anyone still on iOS 14 ? I’m presenting a VC that is not on a Navigation hierarchy with formSheet, and any of the hero transitions done on that app previously make it break