Mercurial > public > geoquiz
diff GeoQuiz/Logic/UserDataModel.swift @ 14:136928bae534
add user profile
author | Dennis C. M. <dennis@denniscm.com> |
---|---|
date | Wed, 19 Oct 2022 07:56:33 +0200 |
parents | |
children | f140bb277c96 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/GeoQuiz/Logic/UserDataModel.swift Wed Oct 19 07:56:33 2022 +0200 @@ -0,0 +1,26 @@ +// +// UserDataModel.swift +// GeoQuiz +// +// Created by Dennis Concepción Martín on 18/10/22. +// + +import Foundation +import SwiftUI + +struct UserData: Codable { + + // Settings + var haptics: Bool = true + var sound: Bool = true + var numberOfLives: Int = 25 + + // Profile + var username: String = "Anonymous" + var imageData: Data? + + var uiImage: UIImage? { + guard let imageData = imageData else { return nil } + return UIImage(data: imageData) + } +}