1

I have this code that was working perfectly and when I updated to ios 14 it stopped working.

Debugging the app I noticed that the code inside the closure was not working.

func replaceWindowRootWith(flow: Flow, step: Step, fadeAnimation: Bool = true, addDelay: Bool = false) -> FlowContributors {
    Flows.whenReady(flow1: flow) { [weak self] root in
        root.hero.isEnabled = true
        root.hero.modalAnimationType = fadeAnimation ? .fade : .none
        if let currentRoot = self?.window?.rootViewController {
            let delay = addDelay ? 0.2 : 0
            DispatchQueue.main.asyncAfter(deadline: .now() + delay) {
                print("REPLACING - \(step.self)")
                Hero.shared.cancel(animate: false)
                currentRoot.hero.replaceViewController(with: root)
            }
        } else {
            self?.window?.rootViewController = root
            self?.window?.makeKeyAndVisible()
        }
    }
    return .one(flowContributor: .contribute(withNextPresentable: flow,
                                             withNextStepper: OneStepper(withSingleStep: step)))
}

The code inside the DispatchQueue closure doesn't run. Anyone had the same problem or found a solution to this yet?

8
  • You didn't have any problems with dispatchQueue in ios14? That is just illustrative none of the code I have inside the closure works
    – rickrvo
    Sep 17, 2020 at 13:55
  • I've updated my question to make it clearer...
    – rickrvo
    Sep 17, 2020 at 13:56
  • I posted the actual code. breakpoint hits this line: let delay = addDelay ? 0.2 : 0 then doesn't hit breakpoint inside the closure
    – rickrvo
    Sep 17, 2020 at 14:16
  • Yes it is ready. When something is working normally and just a ios update messes it up. People could have found similar problems and/or a solution. Just by a dispatchqueue being fired and not activated is something strange and NOT DEBUGABLE. hence the questions to check if more people have similar issues.
    – rickrvo
    Sep 17, 2020 at 14:24
  • 1
    Many people are reporting this error, in my project it happens too Sep 17, 2020 at 14:46

1 Answer 1

1

This is what I get when turning one every memory analysis I can when launching our app. With a bit of luck, I can always find this runloop stuck from a code block.

I have a number of code-blocks chained up to get to that display. I removed some animation-related blocks to simplify runtime yet no cigare. Still looking into it but there is definitly something REALLY fishy in iOS 14 code blocks.

This is also reproducible under iOS SIM 14.1 from XC12.1-GM.

NSRunloop stuck in dispatch

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.