Add new password attempt table
This commit is contained in:
parent
61ee809df5
commit
54b1cc1884
2 changed files with 29 additions and 1 deletions
28
password/data/model/PasswordAttempt.swift
Normal file
28
password/data/model/PasswordAttempt.swift
Normal file
|
@ -0,0 +1,28 @@
|
|||
//
|
||||
// PasswordAttempt.swift
|
||||
// password
|
||||
//
|
||||
// Created by Markus Thielker on 17.01.25.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import SwiftData
|
||||
|
||||
@Model
|
||||
class PasswordAttempt: Identifiable {
|
||||
|
||||
@Attribute(.unique) var id: UUID
|
||||
var password: UUID
|
||||
|
||||
var timestamp: Date
|
||||
var isSuccessful: Bool
|
||||
var typingTime: Double
|
||||
|
||||
init(id: UUID = UUID(), password: UUID, timestamp: Date = Date(), isSuccessful: Bool, typingTime: Double) {
|
||||
self.id = id
|
||||
self.password = password
|
||||
self.timestamp = timestamp
|
||||
self.isSuccessful = isSuccessful
|
||||
self.typingTime = typingTime
|
||||
}
|
||||
}
|
|
@ -60,7 +60,7 @@ struct passwordApp: App {
|
|||
authenticate()
|
||||
}
|
||||
}
|
||||
.modelContainer(for: [Password.self])
|
||||
.modelContainer(for: [Password.self, PasswordAttempt.self])
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue