Open kluku opened 3 years ago
Try to use the following: searchTextField.hero.modifiers = [.useLayerRenderSnapshot] It solve the problem for me
Hey! I am experiencing the same issue, [.useLayerRenderSnapshot] did not work.
I'm also experiencing this but searchTextField.hero.modifiers = [.useLayerRenderSnapshot] didn't seem to work for me
I'm experiencing the same thing. Here's a gif and a sample project in case it helps
The Sample App is basically a new stock Xcode project with just 1 ViewController with a ctr
import UIKit
import Hero
class ViewController: UIViewController {
static var ctr = 1
override func viewDidLoad() {
super.viewDidLoad()
self.isHeroEnabled = true
self.view.backgroundColor = .white
addButton()
}
func addButton() {
let button = UIButton(frame: self.view.frame)
button.hero.id = "daButton"
self.view.addSubview(button)
button.setTitleColor(.blue, for: .normal)
button.setTitle("Button \(ViewController.ctr)", for: .normal)
ViewController.ctr += 1
button.addTarget(self, action: #selector(didTap), for: .touchUpInside)
}
@objc func didTap() {
let nextVC = ViewController()
nextVC.hero.modalAnimationType = .fade
nextVC.isHeroEnabled = true
self.present(nextVC, animated: true)
}
}
I can add to this discussion that for me the delay is only noticeable when the new ViewController is presented modally. There is no delay when the new ViewController is added to the navigation stack via self.navigationController?.push. And I see the delay only on devices with iOS >= 15.
After some more evaluation I could narrow down the delay to the circumstance that the statusbar is being hidden in the modal view (triggered from its viewWillAppear)
What did you do?
I'm pushing a new view controller with Hero, nothing special. Going from the Home module to Search by tapping on the search field; the search field should move to the top.
In my Home module, I have the following configuration:
And in the search module just this:
What did you expect to happen?
Well, the transition should happen.
What happened instead?
... and it does, but with a noticeable delay of 0.5s. I logged everything on the console and this is how it looks like:
Note the delay of 0.53s and the last line. Before the console shows this line, nothing happens. It seems that the transition animation starts precisely when this line is printed on the console. Unfortunately, a quick google search for this log message doesn't show anything. When I disable Hero transition, there is no delay and no
dead reply from commit sync
line in the logs (just an ordinary "push" animation).General Information
Hero Version: 1.5.0
iOS Version(s): 14.0, 14.2
Swift Version: 5
Devices/Simulators: iPhone 8 Plus (simulator), iPhone Xr iOS 14.0 (device)
Reproducible in Examples? (Yes/No): Yes, every time.
Demo Project
Unfortunately not allowed, maybe I'll create one from scratch later.