在ImageSlideshow中添加url数组作为InputSource

时间:2017-06-16 05:32:07

标签: swift

我想添加网址数组

let afNetworkingSource = [AFURLSource(urlString: "https://wallpaperscraft.com/image/balloon_flight_plant_91681_1920x1080.jpg")!, 
                          AFURLSource(urlString: "https://images.unsplash.com/photo-1463595373836-6e0b0a8ee322?w=1080")!]

1 个答案:

答案 0 :(得分:1)

var afNetworkingSource = Array<AFURLSource>()

if  let source = getUrlSource("https://wallpaperscraft.com/image/balloon_flight_plant_91681_1920x1080.jpg") {
    afNetworkingSource.append(source)
}



func getUrlSource(str:String) -> AFURLSource? {
     return AFURLSource(urlString: str) {
}