hyperoslo / Gallery

📹 Your next favorite image and video picker

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

App crash on the LightBox Presend Option

sheikpunia1 opened this issue · comments

When i select the multiple image's and and after that call it like this

func galleryController(_ controller: GalleryController, requestLightbox images: [Image]) {
LightboxConfig.DeleteButton.enabled = true

    SVProgressHUD.show()
    Image.resolve(images: images, completion: { [weak self] resolvedImages in
        SVProgressHUD.dismiss()
        self?.showLightbox(images: resolvedImages.compactMap({ $0 }))
    })
}

// It give crash on this section on the
gallery.present(lightbox, animated: true, completion: nil) (Error says "Thread 1: Fatal error: Unexpectedly found nil while unwrapping")

let lightboxImages = images.map({ LightboxImage(image: $0) })
let lightbox = LightboxController(images: lightboxImages, startIndex: 0)
lightbox.dismissalDelegate = self

    gallery.present(lightbox, animated: true, completion: nil)   

Same error here