Giter Club home page Giter Club logo

Comments (22)

MarkerwApk avatar MarkerwApk commented on July 17, 2024 3

Ok, I thing it'a issue, when you don't pass view. HUD use keyWindow. Changes for iOS 15: https://developer.apple.com/documentation/uikit/uiwindow/1621612-keywindow

It's a fork with commit for this issue: kevin-zqw@597e660

from pkhud.

MarkerwApk avatar MarkerwApk commented on July 17, 2024 3

I don't change library. I only, change my local code:
from:
image

to:
image

from pkhud.

rferbesa avatar rferbesa commented on July 17, 2024 1

I've been experienced this problem since a couple of months ago when the user opens a deep link (the HUD is shown) and the app is not ready yet.
After trying several things I finally tried this, thinking it would be the ultimate solution:

            if UIApplication.shared.keyWindow != nil {
                HUD.show(.progress)
            }

But I'm still receiving crashes in this line (HUD.show(.progress))! Why?? It has no sense to me.
Anyway I'm going to test @MarkerwApk and add onView: view to the call and see what it happens.

from pkhud.

tthejus avatar tthejus commented on July 17, 2024

Me too

from pkhud.

MarkerwApk avatar MarkerwApk commented on July 17, 2024

Info from Crashlytics
image
image

from pkhud.

arsalangolestanekh avatar arsalangolestanekh commented on July 17, 2024

Do you know the way how to fix those crashes?

from pkhud.

MarkerwApk avatar MarkerwApk commented on July 17, 2024

No :( I can't reproduce in debug. I have only reports from users. You pass onView parameter?

from pkhud.

arsalangolestanekh avatar arsalangolestanekh commented on July 17, 2024

I think it is an answer, I think we should pass view

from pkhud.

arsalangolestanekh avatar arsalangolestanekh commented on July 17, 2024

Wow, @MarkerwApk when was it fix?

do we have this change in the latest version?

from pkhud.

MarkerwApk avatar MarkerwApk commented on July 17, 2024

I thing no. I will try pass UIView and I will be observe Crashlytics.

from pkhud.

AlexNsbmr avatar AlexNsbmr commented on July 17, 2024

@MarkerwApk did you make a pull request to the main repo? Sounds like it's a easy fix

from pkhud.

abmomen avatar abmomen commented on July 17, 2024

I am also getting crash on this method when I change the scheme and run the project without running a clean build.
If I clean and build again then it does not crash anymore.

from pkhud.

raphaels17 avatar raphaels17 commented on July 17, 2024

yes i know how to fix it, however I dont know how to contribute to the improvemnet

this should will fix it

var window = UIApplication.shared.keyWindow //--> nil = crash if #available(iOS 13.0, *) { window = UIApplication.shared.connectedScenes .filter({$0.activationState == .foregroundActive}) .compactMap({$0 as? UIWindowScene}) .first?.windows .filter({$0.isKeyWindow}).first }

from pkhud.

realchema avatar realchema commented on July 17, 2024

Has anyone managed to fix the problem? I’m experiencing the same issue from iOS 15.4 and 15.5

from pkhud.

MarkerwApk avatar MarkerwApk commented on July 17, 2024

Has anyone managed to fix the problem? I’m experiencing the same issue from iOS 15.4 and 15.5

#283 (comment)

from pkhud.

MarkerwApk avatar MarkerwApk commented on July 17, 2024

I've been experienced this problem since a couple of months ago when the user opens a deep link (the HUD is shown) and the app is not ready yet. After trying several things I finally tried this, thinking it would be the ultimate solution:

            if UIApplication.shared.keyWindow != nil {
                HUD.show(.progress)
            }

But I'm still receiving crashes in this line (HUD.show(.progress))! Why?? It has no sense to me. Anyway I'm going to test @MarkerwApk and add onView: view to the call and see what it happens.

Look at documentation: https://developer.apple.com/documentation/uikit/uiwindow/1621612-keywindow
It's very bad from Apple side(change behavior and implementation). "onView" should resolve issue.

from pkhud.

rferbesa avatar rferbesa commented on July 17, 2024

Thanks!! I'm gonna try your solution.

from pkhud.

rferbesa avatar rferbesa commented on July 17, 2024

In my case I'm still having issues with the deep linking, I'm pretty sure this is because the view is not ready yet, so I'm trying:

            let isViewVisible = self.viewIfLoaded?.window != nil
            if isViewVisible {
               HUD.show(.progress, onView: self.view)
            }

from pkhud.

rferbesa avatar rferbesa commented on July 17, 2024

Well, I'm still having crashes with this last code...I'll find another option.

from pkhud.

realchema avatar realchema commented on July 17, 2024

@rferbesa try this
let keyWindow = UIApplication.shared.windows.filter {$0.isKeyWindow}.first

pass the variable to onView and let me know

from pkhud.

rferbesa avatar rferbesa commented on July 17, 2024

Thanks! I'll try that and let you know.

from pkhud.

rferbesa avatar rferbesa commented on July 17, 2024

It didn't work. I think is a problem of how my app detects if it's in background or not (or if the view is being shown or not). I won't show the spinner in the deep linking flow to "fix" this.

from pkhud.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.