我想改變這個變量循環變量成爲循環中迅速:在迅速
var image1 = UIImage(named: "image1")
var image2 = UIImage(named: "image2")
var image3 = UIImage(named: "image3")
var image4 = UIImage(named: "image4")
var image5 = UIImage(named: "image5")
var image6 = UIImage(named: "image6")
var image7 = UIImage(named: "image7")
images.append(image1!)
images.append(image2!)
images.append(image3!)
images.append(image4!)
images.append(image5!)
images.append(image6!)
images.append(image7!)
,但我得到了循環錯誤:
for var i = 1; i < 8; i++
{
var image(i) = UIImage(named: "image\(i)")
images.append("image\(i)"!)
}
如何得到正確的我裏面VAR圖像和images.append名稱?