SachK13 / SKActivityIndicatorView

A lightweight And Easy-To-Use ActivityIndicator For Your iOS App.
MIT License
66 stars 21 forks source link

Loader gets crashed in iOS 13 #11

Closed hilajqinnovation closed 4 years ago

hilajqinnovation commented 4 years ago

The loader gets crashed in SKActivityIndicatorView.swift, inside configureActivityIndicator(withStatusMessage:, isUserInteractionEnabled:) method. The crash is actually happened in these lines, if activityIndicatorView?.superview == nil && userInteractionStatus == false { backgroundView = UIView.init(frame: window!.frame) backgroundView!.backgroundColor = backgroundViewColor window!.addSubview(backgroundView!) backgroundView!.addSubview(activityIndicatorView!) } else { window!.addSubview(activityIndicatorView!) }

here in the first line. and I checked the backgroundView is getting nil. Also the pod is not updated to support iOS 13. Please help.

aliwaseem72 commented 4 years ago

You can resolve it to comment " var window: UIWindow?" if its not needed. But I need to use UIWindow for webview, in older version of iOS for webview I need to add "var window: UIWindow?". So I'm stuck because there is I can't add OS version check. Please help me if there is a solution you found.

aliwaseem72 commented 4 years ago

@SachK13 Have you any idea to resolve it. Because due to the use of WKWebView I need to add var window: UIWindow? for older version support, and It crashed for iOS 13. If I remove the var window: UIWindow? then I get the crash for WKWebView in older versions, and it solution to add var window: UIWindow? in app delegate.

SachK13 commented 4 years ago

@hilajqinnovation @aliwaseem72 This has been fixed in 1.0.0. and code has been updated to support iOS 13 and above with Swift 5.x+.