Created for a Job Interview
The tasks were:
-
Create a table view with numbers from 100 to 1
-
Numbers that are divisible by 2 should be in red and should be separated by 10 points from the left of the screen (I try it first with identation, but It was meant to be done with autolayout)
-
Numbers that are divisible by 3 should be in blue and be centered
-
Numbers that are divisible by 2 and 3 should be in pink and be separated by 10 points from the right (Autolayout also)
-
For all the rest of the numbers the app should call a function named longRunningFunction which will return the color to apply to the label and will be centered. “longRunningFunction” is a function that should take a long time to return and will return a random color between red, blue and black. For this please simulate a function that takes 2 seconds to complete. This should be calculated only once for each number. (To test if you know GCD)