ImageViewer icon indicating copy to clipboard operation
ImageViewer copied to clipboard

EXC_BAD_INSTRUCTION on UIApplication extension force unwrap on flatMap

Open revdevnick opened this issue 6 years ago • 3 comments

I find when initializing the GalleryViewController that a crash happens on line 14 in UIApplication.swift. While using flatMap there is a force unwrap which is crashing my application. This needs to be handled properly and why is this happening?

revdevnick avatar Jan 10 '19 21:01 revdevnick

@revdevnick did you find any solution?

iOS-Ashish avatar Feb 13 '20 13:02 iOS-Ashish

did this bug fix yet, i use version 6.0.0 and have the same issue, i found the issues that have the same problem but the i dont understand the answer #223 https://github.com/Krisiacik/ImageViewer/issues/233

LeXuanKhanh avatar Feb 25 '20 03:02 LeXuanKhanh

A workaround in two steps:

  1. Add a var window: UIWindow? in AppDelegate
  2. Set its value at the end of SceneDelegate's scene(_ scene: willConnectTo: options:):
if let appDelegate = UIApplication.shared.delegate as? AppDelegate {
    appDelegate.window = window
}

abynim avatar May 28 '20 11:05 abynim