comparison LazyBear/Views/Company/Helpers/KeyStatsList.swift @ 445:7d1c4dc8d1d8

Change presentationMode to Binding
author Dennis Concepción Martín <dennisconcepcionmartin@gmail.com>
date Tue, 22 Jun 2021 19:56:59 +0200
parents ffbb1dbab531
children 8621ba6fd457
comparison
equal deleted inserted replaced
444:428109b1e3f0 445:7d1c4dc8d1d8
7 7
8 import SwiftUI 8 import SwiftUI
9 9
10 struct KeyStatsList: View { 10 struct KeyStatsList: View {
11 var keyStats: KeyStatsModel 11 var keyStats: KeyStatsModel
12 12 @Binding var isPresented: Bool
13 let displayWords: DisplayWordsModel = parseJSON("DisplayWords.json") 13 let displayWords: DisplayWordsModel = parseJSON("DisplayWords.json")
14 @Environment(\.presentationMode) var keyStatsListPresentation
15 14
16 var body: some View { 15 var body: some View {
17 NavigationView { 16 NavigationView {
18 Form { 17 Form {
19 let mirror = Mirror(reflecting: keyStats) 18 let mirror = Mirror(reflecting: keyStats)
35 } 34 }
36 } 35 }
37 .navigationTitle("Key Stats") 36 .navigationTitle("Key Stats")
38 .toolbar { 37 .toolbar {
39 ToolbarItem(placement: .navigationBarLeading) { 38 ToolbarItem(placement: .navigationBarLeading) {
40 Button(action: { keyStatsListPresentation.wrappedValue.dismiss() }) { 39 Button(action: { self.isPresented.toggle() }) {
41 Image(systemName: "multiply") 40 Image(systemName: "multiply")
42 } 41 }
43 42
44 } 43 }
45 } 44 }
94 year2ChangePercent: 123.4, 93 year2ChangePercent: 123.4,
95 year5ChangePercent: 123.4, 94 year5ChangePercent: 123.4,
96 exDividendDate: "2020-01-01", 95 exDividendDate: "2020-01-01",
97 nextDividendDate: "2020-01-01", 96 nextDividendDate: "2020-01-01",
98 nextEarningsDate: "2020-01-01" 97 nextEarningsDate: "2020-01-01"
99 ) 98 )
99 , isPresented: .constant(true)
100 ) 100 )
101 } 101 }
102 } 102 }