我想添加网址数组
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")!]
答案 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) {
}