Krisiacik / ImageViewer

An image viewer à la Twitter
MIT License
2.53k stars 385 forks source link

EXC_BREAKPOINT #233

Closed springlo closed 4 years ago

springlo commented 4 years ago
    static var applicationWindow: UIWindow {
        return (UIApplication.shared.delegate?.window?.flatMap { $0 })!
    }

in Xcode 11, UIApplication.shared.delegate?.window = nil

Rveci commented 4 years ago

how to resolve ?

alimirshad commented 4 years ago

@Visaut What do you want to achieve?

Rveci commented 4 years ago

@alimirshad in Line : return (UIApplication.shared.delegate?.window?.flatMap { $0 })! Error -> "Fatal error: Unexpectedly found nil while unwrapping an Optional value"

use Xcode 11 , How to resolve ?

alimirshad commented 4 years ago

@Visaut you need to get Window from UIView. or if you need it in app delegate you need to assign the window to appdelegate window property. you can't force unwrap it like you are doing

Rveci commented 4 years ago

Thank you @alimirshad