Muhamméd Muhamméd - 1 year ago 228
Swift Question

Passing dynamic array to ImageSlideshow ios

Iam trying to use **ImageSlideshow
** library

and i followed the documentation step by step and it's working perfectly

but i can only pass static images and here's my code :

slideShow.setImageInputs([AFURLSource(urlString: "")!, AFURLSource(urlString: "")!, AFURLSource(urlString: "")!])

But i need to get the images url from JSON array dynamically and pass it to slideshow like that :

var jsonArray:NSarray = [String]


any idea how can i do that ?

Answer Source

try this :

let arr = { AFURLSource(urlString: $0 as! String)!}

hope it be helpful :-)