I was wondering how I can convert the below java code to Swift 4.
int randomNoteIndex = myArray[0] + (int) (Math.random() * (myArray[1] - myArray[0] + 1));
Here is what i tried but I always get the same number myArray[0] everytime
let randomNoteIndex = myArray[0] + Int(arc4random_uniform(1) * (UInt32(myArray[1]) - UInt32(myArray[0]) + UInt32(1)))