Mercurial > public > geoquiz
view GeoQuiz/Models/UserDataModel.swift @ 31:9d6dd0e59c22
remove dataset and add new screenshots
author | Dennis C. M. <dennis@denniscm.com> |
---|---|
date | Fri, 11 Nov 2022 08:59:02 +0100 |
parents | 3f4b366d476d |
children |
line wrap: on
line source
// // UserDataModel.swift // GeoQuiz // // Created by Dennis Concepción Martín on 18/10/22. // import Foundation import SwiftUI struct UserDataModel: Codable { // Settings var haptics: Bool = true var sound: Bool = true var numberOfLives: Int = 25 var guessTheFlagAspectRatio: GuessTheFlagAspectRatio = .original // Profile var username: String = "Unnamed" var imageData: Data? var uiImage: UIImage? { guard let imageData = imageData else { return nil } return UIImage(data: imageData) } } enum GuessTheFlagAspectRatio: String, Codable, CaseIterable { case original = "Original" case circular = "Circular" case rectangular = "Rectangular" var localizedName: LocalizedStringKey { LocalizedStringKey(rawValue) } }