I am looking for the best way to pass a Difficulty level between View Controllers.
At present I have this setup as a String. There are three options Easy/Medium/Hard, I know this is not the best way to do this so am looking for what would be the correct approach here.
At the moment I check the tag on the button and set a string value like below:
if (sender.tag == 10) {
self.turnDifficulty = @"Easy";
} else if (sender.tag == 20) {
self.turnDifficulty = @"Medium";
} else if (sender.tag == 30) {
self.turnDifficulty = @"Hard";
}
I then pass the value over in the prepareForSegue
method. What is the alternate to this approach? Although there is no issue here and this works fine, it is not very clean working with strings here.