Swipe-That_pic/Swipe That Pic/Models/Extension.swift

17 lines
269 B
Swift
Raw Normal View History

2024-07-26 13:16:48 +00:00
//
// Extension.swift
// Swipe That Pic
//
// Created by Amine Bou on 27/07/2024.
//
import Foundation
import Photos
extension Array {
func random() -> Element {
let randomIndex = Int(arc4random()) % self.count
return self[randomIndex]
}
}