I have 2 UIImageViews connected to an array of images I'm trying compare both once they are displayed but doesn't seems to work. I tried using imageArray[Image Literal] and also imageArray[image1.png, image2.png, image3.png, image4.png, image5.png] I'm not sure what im doing wrong. im not looking for the code although it may help but what im looking is for a someone to guide me to the right direction
@IBOutlet weak var 1ImageView: UIImageView!
@IBOutlet weak var 2ImageView: UIImageView!
let imageArray = [image1.png, image2.png, image3.png, image4.png, image5.png]
func any() {
if (1ImageView != nil) && (2ImageView != nil) && isEqual(image1.png) {
print("match!")
} else if ...// more if statements
…last if statement} else {
print(“no match!”)
}
@IBAction func buttonPressed(_ sender: IUButton) {
any()
}
If this is not possible is there a way to assign an identifier to each of the images inside the array.. sorry for the extra question. there is one answer on comparing 2 images using NSData but Im not sure how to implement it to an array. thanks and sorry but the newbie question.