I can't continue with my app and I can't test run it because something is wrong in my code that I don't know how to fix! Here is the code:
import Foundation
extension Array {
mutating func shuffle() {
if count < 2 { return }
for i in 0..<(count - 1) {
let j = Int(arc4random_uniform(UInt32(count - i))) + i
customSwap(a: &self[i], b: &self[j])
}
}
}
func customSwap<T>(a: inout T, b: inout T) {
let temp = a
a = b
b = temp
}