Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SWIFT

random element from array swift

let array = ["Frodo", "Samwise", "Merry", "Pippin"]
print(array.randomElement()!) // Using ! knowing I have array.count > 0
 
PREVIOUS NEXT
Tagged: #random #element #array #swift
ADD COMMENT
Topic
Name
9+6 =