Ray Wenderlich Course Part 4 (up to lesson 35)
As promised I'm finding more time to code today! Not much else to say - let's go! How to Calculate the Difference So the challenge here is to see what is the difference is between the slider value and the target. Ray explains that we can't just do sliderValue - targetValue as the sliderValue could be higher. So one way would be to do an if statement! E.g. var difference = 0 if sliderValue > targetValue { difference = sliderValue - targetValue } else if targetValue > sliderValue { difference = targetValue - sliderValue } else { difference = 0 } Another way would be if difference is < 0 to then add that total again twice over...but that sounds more fiddly and less logical to me! Absolutely NAILED IT! Soooo satisfying! :) Next difference challenge - var difference = currentValue - targetValue if difference < 0 { differenc...