Krisiacik / ImageViewer

An image viewer à la Twitter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

EXC_BREAKPOINT

springlo opened this issue · comments

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

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

how to resolve ?

@Visaut What do you want to achieve?

@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 ?

@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

Thank you @alimirshad