Thanks, that worked! I knew it had to recompute somehow, but thought it was enough to just use the updateHorse() function. I ended up putting the recalculation at the end of the IBAction to keep it clean
if horseIndex < horseNumber {
horseIndex -= 1
}
if horseIndex == horseNumber {
horseIndex -= 1
}
if horseIndex == -1 {
horseIndex = horseNumber
}
currentHorse = myHorses[horseIndex]
updateHorse()
}
Topic:
Programming Languages
SubTopic:
Swift
Tags: