-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMockData.swift
31 lines (29 loc) · 1.42 KB
/
MockData.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import Foundation
extension Moment {
static func mockData() -> [Moment] {
let calendar = Calendar.current
let documentsDirectory = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0]
return [
Moment(
imageURL: documentsDirectory.appendingPathComponent("sunset.jpg"),
note: "A beautiful sunset at the beach. The colors were absolutely breathtaking!",
timestamp: calendar.date(byAdding: .hour, value: -2, to: Date()) ?? Date()
),
Moment(
imageURL: documentsDirectory.appendingPathComponent("coffee.jpg"),
note: "Morning coffee at my favorite café. Perfect way to start the day!",
timestamp: calendar.date(byAdding: .hour, value: -5, to: Date()) ?? Date()
),
Moment(
imageURL: documentsDirectory.appendingPathComponent("hike.jpg"),
note: "Weekend hike in the mountains. The fresh air was rejuvenating!",
timestamp: calendar.date(byAdding: .day, value: -1, to: Date()) ?? Date()
),
Moment(
imageURL: documentsDirectory.appendingPathComponent("dinner.jpg"),
note: "Family dinner - mom's special recipe never disappoints",
timestamp: calendar.date(byAdding: .day, value: -2, to: Date()) ?? Date()
)
]
}
}