vikmeup / SCLAlertView-Swift

Beautiful animated Alert View. Written in Swift
MIT License
5.3k stars 760 forks source link

Crash at UIApplication.shared.keyWindow! as UIWindow #474

Closed theofficejackpot closed 8 months ago

theofficejackpot commented 3 years ago

Hi, please help me add some code to prevent the crash at line 712 in SCLAlertView.swift

open func showTitle(_ title: String, subTitle: String, timeout: SCLTimeoutConfiguration?, completeText: String?, style: SCLAlertViewStyle, colorStyle: UInt?=0x000000, colorTextButton: UInt?=0xFFFFFF, circleIconImage: UIImage? = nil, animationStyle: SCLAnimationStyle = .topToBottom) -> SCLAlertViewResponder { selfReference = self view.alpha = 0 view.tag = uniqueTag view.accessibilityIdentifier = uniqueAccessibilityIdentifier let rv = UIApplication.shared.keyWindow! as UIWindow

Crashes at line above iOS 14, iPhone, Swift

algrid commented 8 months ago

this should be fixed in master currently