'Swift 5 or up - Image view on pickerview

My images from "2.jpg" to "7.jpg" shows but the first image("1.jpg") on my simulator. what do I need to change?


var imageFileName = ["1.jpg","2.jpg","3.jpg","4.jpg","5.jpg","6.jpg","7.jpg"]


for i in 0 ..< MAX_ARRAY_NUM {
            
            let image = UIImage(named: imageFileName[i])
            
            imageArray.append(image)
         
            lblImageFileName.text = imageFileName[0]
           
            imageView.image = imageArray[0]

enter image description here

enter image description here



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source