Initial Commit
This commit is contained in:
16
Swipe That Pic/Models/Extension.swift
Normal file
16
Swipe That Pic/Models/Extension.swift
Normal file
@ -0,0 +1,16 @@
|
||||
//
|
||||
// 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]
|
||||
}
|
||||
}
|
17
Swipe That Pic/Models/Item.swift
Normal file
17
Swipe That Pic/Models/Item.swift
Normal file
@ -0,0 +1,17 @@
|
||||
//
|
||||
// Item.swift
|
||||
// Swipe That Pic
|
||||
//
|
||||
// Created by Amine Bou on 26/07/2024.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import SwiftData
|
||||
|
||||
@Model
|
||||
final class Item {
|
||||
@Attribute(.unique) var localIdentfier: String
|
||||
init(localIdentfier: String) {
|
||||
self.localIdentfier = localIdentfier
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user