init commit - bring project over from Mood
This commit is contained in:
63
Shared/Models/Mood.swift
Normal file
63
Shared/Models/Mood.swift
Normal file
@@ -0,0 +1,63 @@
|
||||
//
|
||||
// Mood.swift
|
||||
// Feels
|
||||
//
|
||||
// Created by Trey Tartt on 1/5/22.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import SwiftUI
|
||||
|
||||
enum Mood: Int {
|
||||
case horrible
|
||||
case bad
|
||||
case average
|
||||
case good
|
||||
case great
|
||||
case missing
|
||||
|
||||
var strValue: String {
|
||||
switch self {
|
||||
case .horrible:
|
||||
return "Horrible"
|
||||
case .bad:
|
||||
return "Bad"
|
||||
case .average:
|
||||
return "Average"
|
||||
case .good:
|
||||
return "Good"
|
||||
case .great:
|
||||
return "Great"
|
||||
case .missing:
|
||||
return "Missing"
|
||||
}
|
||||
}
|
||||
|
||||
static var allValues: [Mood] {
|
||||
return [Mood.horrible, Mood.bad, Mood.average, Mood.good, Mood.great]
|
||||
}
|
||||
|
||||
var icon: Text {
|
||||
switch self {
|
||||
|
||||
case .horrible:
|
||||
return Text("😫")
|
||||
case .bad:
|
||||
return Text("🙁")
|
||||
case .average:
|
||||
return Text("😐")
|
||||
case .good:
|
||||
return Text("🙂")
|
||||
case .great:
|
||||
return Text("😆")
|
||||
case .missing:
|
||||
return Text("🚫")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extension Mood: Identifiable {
|
||||
var id: Int {
|
||||
rawValue
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user