-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJournalEntryDetail.swift
More file actions
44 lines (41 loc) · 1.49 KB
/
JournalEntryDetail.swift
File metadata and controls
44 lines (41 loc) · 1.49 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
//
// JournalEntryDetail.swift
// JRNLSwiftUI
//
// Created by iOS17Programming on 16/10/2023.
//
import SwiftUI
struct JournalEntryDetail: View {
var selectedJournalEntry: JournalEntry
var body: some View {
ScrollView {
VStack{
Spacer().frame(height: 30)
Text(selectedJournalEntry.date.formatted(.dateTime.day().month().year()))
.font(.title)
.fontWeight(.bold)
.frame(maxWidth: .infinity, alignment: .trailing)
Spacer().frame(height: 30)
Text(selectedJournalEntry.entryTitle)
.font(.title)
.fontWeight(.bold)
.frame(maxWidth: .infinity, alignment: .leading)
Spacer().frame(height: 30)
Text(selectedJournalEntry.entryBody)
.font(.title2)
.frame(maxWidth: .infinity, alignment: .leading)
Spacer().frame(height: 30)
Image(uiImage: selectedJournalEntry.photo ?? UIImage(systemName: "face.smiling")!)
.resizable()
.frame(width: 300, height: 300)
Spacer().frame(height: 30)
MapView(journalEntry: selectedJournalEntry)
.frame(width: 300, height: 300)
}.padding()
.navigationTitle("Entry Detail")
}
}
}
#Preview {
JournalEntryDetail(selectedJournalEntry: testData[0])
}