iOS Build a Simple iPhone App with Swift Structs As Data Models Finishing Up Our Model

Michael Psoinos
Michael Psoinos
8,178 Points

Int has a class method for generating a random number.

Just pointing out that Int now has a class method for generating a random number. You can simply write:

let randomNumber = Int.random(in: 0..<facts.count)

Much simpler and you don't have to import GameKit.

1 Answer

Saadoun Alerris
Saadoun Alerris
7,086 Points

This is way easier. Thank you.