Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MKProgress not showing in ios 13 #3

Open
arishanapalli opened this issue Sep 28, 2020 · 5 comments
Open

MKProgress not showing in ios 13 #3

arishanapalli opened this issue Sep 28, 2020 · 5 comments

Comments

@arishanapalli
Copy link

arishanapalli commented Sep 28, 2020

MKProgress.show() not working from iOS 13 version.

DispatchQueue.main.async{
MKProgress.show()
}

This happens after adding SceneDelegate to project.

below version its works fine.

@fauzibinfaisal
Copy link

Yes, this has happened to me too. Any solution for this issue?

@fauzibinfaisal
Copy link

Any solution to make it work for ios 13 or above?

@kamirana4
Copy link
Owner

@fauzibinfaisal Please try pods by fetching the source code as below. Meanwhile i will fix the issue.

pod 'MKProgress', :git => 'https://github.com/kamirana4/MKProgress.git'

@fauzibinfaisal
Copy link

fauzibinfaisal commented Jan 12, 2021

I already tried using pod 'MKProgress', :git => 'https://github.com/kamirana4/MKProgress.git', but didn't worked.

Pre-downloading: `MKProgress` from `https://github.com/kamirana4/MKProgress.git`
Downloading dependencies
Installing MKProgress (1.2.0)

Okay, thank you for the response @kamirana4. I hope it will fix asap. Nice Library btw

@thanhfam
Copy link

thanhfam commented Mar 12, 2021

This can be fixed manually by editing in MKProgress.swift
From:

fileprivate func getHUDWindow() -> UIWindow {
    let hudWindow = UIWindow()
                
    hudWindow.frame = UIScreen.main.bounds
    hudWindow.isHidden = false
    hudWindow.windowLevel = UIWindow.Level.normal
    hudWindow.backgroundColor = UIColor.clear
    
    let controller = MKProgressViewController()
    hudWindow.rootViewController = controller
    
    return hudWindow
}

To:

fileprivate func getHUDWindow() -> UIWindow {
    let hudWindow = UIWindow()
         
    if #available(iOS 13.0, *) {
        let windowScene = UIApplication.shared
            .connectedScenes
            .filter { $0.activationState == .foregroundActive }
            .first
        
        if let windowScene = windowScene as? UIWindowScene {
            hudWindow.windowScene = windowScene
        }
    }
    
    hudWindow.frame = UIScreen.main.bounds
    hudWindow.isHidden = false
    hudWindow.windowLevel = UIWindow.Level.normal
    hudWindow.backgroundColor = UIColor.clear
    
    let controller = MKProgressViewController()
    hudWindow.rootViewController = controller
    
    return hudWindow
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants