I am trying to assign a property a new value inside a struct but when I try to I get "Cannot assign 'x' in 'self' ".
struct gallery {
var x = 0
let picture = [
"landscape.jpg",
"paris.jpg",
"polygons.jpg"
]
func getImage() -> String{
if (x > picture.count){
x = 0
return picture[x]
} else{
return picture[x]
}
}
}