How do I randomize or shuffle the elements within an array in Swift? For example, if my array consists of 52 playing cards, I want to shuffle the array in o
In Swift 2.0, GameplayKit may come to the rescue! (supported by iOS9 or later)
import GameplayKit func shuffle() { array = GKRandomSource.sharedRandom().arrayByShufflingObjectsInArray(array) }