Use the Swift random generator to make the Image View show a different, random ball image each time you press the Ask button.
Hint 1: You can generate a random integer (whole number) between x and y with the code:
Int.random(in: x...y)
Hint 2: Try printing out the random number.
Hint 3: We’ve already created an array of all the ball images and named ballArray
Hint 4: Try figuring out how to print out the 3rd element in the array.
ballArray[x]
Hint 5: Try to use the random number to get a random element from the array.
Run your app and ask your Magic 8 Ball to predict the future*
* Accuracy may vary depending on individual iPhone Psychic Rating (IPR).
GOAL