*Consolidation Entry* 2nd Basic App Part 2

The second and final part of my 'suntanning' app! A key, KEY thing to remember here is that I'm simply trying to replicate the functionality in Mark Price's project for the wage/hour thing. The actual suntanning number is irrelevant at this stage, so are other lofty ambitions of using APIs to get actual temperature from actual cities - that can easily be looked at another time. Here is all I want to achieve today:

  • Getting 'clear calculator' button and function to work
  • Making sure typing onto the labels is slick and works ok etc
  • Add in minutes and hours to the results label - calculate function needs overhaul 
  • Attempt to do enum for skin type, then factoring that into calculations!

The last one is the hardest by far; again if I can't do it at this stage, then that's totally fine!

Clear calculator - doing this without any help at all. 

Done! Done it as a separate function and put that into the button body, but didn't actually really need to. 


OK, the typing onto labels.... Let's see if there's anything to do about that... Nope. Nothing concrete at least. 


Now the calculate function - I've changed it and made it include local variables of hours and minutes. We'll see if if actually works when running it in a moment...


YES! It works! Woohoo! Quite a bit of logic which I won't go into here, but the label now works a treat. Awesome. Need to update calculator for the temperature to the decimal one, in case people wanted to put a decimal in...


Not even going to try the last bit! That would mean a picker/selector...which I know is really hard on Storyboard. 


So that means the suntan app has been a TOTAL SUCCESS!


Big point to mention here is that the algorithm is in NO WAY ACCURATE. It is purely to demonstrate the point of having two numbers to crunch and to get the result, much like Mark's. All the challenges I have dealt with along the way. It has been incredibly useful to consolidate as I've seen a lot in context. 


This also means I am done with Coursera and Mark Price's projects. I'm going to map out what to do with raywenderlich.com next time. 


Comments

Popular posts from this blog

Coursera Introduction to Programming in Swift - Part 4