Comments (22)
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.
I don't change library. I only, change my local code:
from:
from pkhud.
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.
Me too
from pkhud.
from pkhud.
Do you know the way how to fix those crashes?
from pkhud.
No :( I can't reproduce in debug. I have only reports from users. You pass onView parameter?
from pkhud.
I think it is an answer, I think we should pass view
from pkhud.
Wow, @MarkerwApk when was it fix?
do we have this change in the latest version?
from pkhud.
I thing no. I will try pass UIView and I will be observe Crashlytics.
from pkhud.
@MarkerwApk did you make a pull request to the main repo? Sounds like it's a easy fix
from pkhud.
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.
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.
Has anyone managed to fix the problem? I’m experiencing the same issue from iOS 15.4 and 15.5
from pkhud.
Has anyone managed to fix the problem? I’m experiencing the same issue from iOS 15.4 and 15.5
from pkhud.
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.
Thanks!! I'm gonna try your solution.
from pkhud.
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.
Well, I'm still having crashes with this last code...I'll find another option.
from pkhud.
@rferbesa try this
let keyWindow = UIApplication.shared.windows.filter {$0.isKeyWindow}.first
pass the variable to onView and let me know
from pkhud.
Thanks! I'll try that and let you know.
from pkhud.
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)
- Cannot pass AppStoreConnect Upload in 5.2.1 HOT 1
- Problem with CoreMotion causes UI API called on a background thread, IPhone X series HOT 5
- Decrease size of Progress bar not label content
- Fix travis
- Cocoapod release not updated version 5.3.0 HOT 2
- Build Failed Swift 4.2 carthage 0.33.0 OSX 10.14.5
- Cant use macOS ? HOT 2
- Support for multiple windows on iPadOS
- couldn't find Assets.car in bundle with identifier HOT 1
- 'PKHUD/PKHUD-Swift.h' file not found
- broken, broken
- Support for SwiftUI needed HOT 2
- Too long type-check HOT 1
- Support for Swift Package Manager(SPM) needed
- customView(view: UIView),backgroundColor issue
- progress can not work HOT 1
- how to change the progress frame , I can not find it
- Not working on SwiftUI sheet (modal) HOT 1
- dimsBackground is false,but PKHUD.sharedHUD not hidden container.backgroundView
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pkhud.