hyperoslo / Lightbox

:milky_way: A convenient and easy to use image viewer for your iOS app
https://www.hyper.no
Other
1.62k stars 326 forks source link

Multiple images and video in the array loop #281

Open DharaniDevApp opened 2 years ago

DharaniDevApp commented 2 years ago

How to construct the below array in for loop as i need to append all my photo library items to show in the slider like inbuilt iphone.

let images = [ LightboxImage(imageURL: URL(string: "https://cdn.arstechnica.net/2011/10/05/iphone4s_sample_apple-4e8c706-intro.jpg")!), LightboxImage( image: UIImage(named: "photo1")!, text: "This is an example of a remote image loaded from URL" ), LightboxImage( image: UIImage(named: "photo2")!, text: "", videoURL: URL(string: "https://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4") ), LightboxImage( image: UIImage(named: "photo3")!, text: "This is an example of a local image." ) ]