mess with fake data generator to be more happy
This commit is contained in:
@@ -55,7 +55,10 @@ extension PersistenceController {
|
||||
func generateObjectNotInArray(forDate date: Date = Date(), withMood mood: Mood = .placeholder) -> MoodEntry {
|
||||
let newItem = MoodEntry(context: childContext)
|
||||
newItem.timestamp = Date()
|
||||
newItem.moodValue = Int16(mood.rawValue)
|
||||
newItem.moodValue = Int16.random(in: 2 ... 4)
|
||||
if Int16.random(in: 0 ... 400) % 5 == 0 {
|
||||
newItem.moodValue = Int16.random(in: 0 ... 4)
|
||||
}
|
||||
newItem.forDate = date
|
||||
newItem.weekDay = Int16(Calendar.current.component(.weekday, from: Date()))
|
||||
newItem.canEdit = false
|
||||
@@ -71,7 +74,10 @@ extension PersistenceController {
|
||||
for idx in 1..<1000 {
|
||||
let newItem = MoodEntry(context: viewContext)
|
||||
newItem.timestamp = Date()
|
||||
newItem.moodValue = Int16(Mood.allValues.randomElement()!.rawValue)
|
||||
newItem.moodValue = Int16.random(in: 3 ... 4)
|
||||
if Int16.random(in: 0 ... 400) % 5 == 0 {
|
||||
newItem.moodValue = Int16.random(in: 0 ... 4)
|
||||
}
|
||||
newItem.canEdit = true
|
||||
newItem.canDelete = true
|
||||
|
||||
|
||||
Reference in New Issue
Block a user