Trying to get me feet wet on my first app after watching 6 months of tutorials, ITS TIME!
I'm trying to setup a simple volleyball court with 6 players (buttons). I want to be able to control the button's images and have a simple array of 12 player images. I want to use the array for easy manipulation of rotating the floor lineups etc.
I'm getting stuck with trying to pass a UIImage array value to the button.setImage command. I realize I'm getting mixed up and confusing the UIImage with String etc. but not sure how to correct.
/* UIImage_Literals below have images in them */
var playerPics : [UIImage] = [UIImage_Literal1,UIImage_Literal2UIImage_Literal3]
button.setImage(playerPics, for: .normal) -----ERROR ATTEMPT1
var playerImg : [String] = ["Image2.jpg","Image3.jpg"]
button.setImage(playerImg, for: .normal) -----ERROR ATTEMPT 2
The above is not my exact code and may have bad syntax but its an example of what I'm trying. The button.setImage wants a different type than what I'm providing.
Everyone thank you for your help, I'm a old guy retired but very interested in SWIFT. I realize I'm showing my lack of SWIFT fundamentals here but as mentioned I've been binge watching tutorials too long and have to start at something.