Mercurial > public > lazybear
diff LazyBear/Views/Company/Helpers/KeyStatsList.swift @ 447:8621ba6fd457
Fixes #48
author | Dennis Concepción Martín <dennisconcepcionmartin@gmail.com> |
---|---|
date | Wed, 23 Jun 2021 10:54:47 +0200 |
parents | 7d1c4dc8d1d8 |
children | f71761f166f2 |
line wrap: on
line diff
--- a/LazyBear/Views/Company/Helpers/KeyStatsList.swift Tue Jun 22 19:57:08 2021 +0200 +++ b/LazyBear/Views/Company/Helpers/KeyStatsList.swift Wed Jun 23 10:54:47 2021 +0200 @@ -9,39 +9,27 @@ struct KeyStatsList: View { var keyStats: KeyStatsModel - @Binding var isPresented: Bool let displayWords: DisplayWordsModel = parseJSON("DisplayWords.json") var body: some View { - NavigationView { - Form { - let mirror = Mirror(reflecting: keyStats) - ForEach(Array(mirror.children), id: \.label) { child in /// Iterate over each variable within the class - if let unwrappedValue = unwrapAnyOptional(value: child.value) { - let label = String(child.label!) - HStack { - Text("\(displayWords.keyStats[label]!):") - .font(.callout) - .fontWeight(.semibold) - .lineLimit(1) - - Spacer() - Text(unwrappedValue) - .font(.callout) - .lineLimit(1) - } + Form { + let mirror = Mirror(reflecting: keyStats) + ForEach(Array(mirror.children), id: \.label) { child in /// Iterate over each variable within the class + if let unwrappedValue = unwrapAnyOptional(value: child.value) { + let label = String(child.label!) + HStack { + Text("\(displayWords.keyStats[label]!):") + .font(.callout) + .fontWeight(.semibold) + .lineLimit(1) + + Spacer() + Text(unwrappedValue) + .font(.callout) + .lineLimit(1) } } } - .navigationTitle("Key Stats") - .toolbar { - ToolbarItem(placement: .navigationBarLeading) { - Button(action: { self.isPresented.toggle() }) { - Image(systemName: "multiply") - } - - } - } } } @@ -96,7 +84,6 @@ nextDividendDate: "2020-01-01", nextEarningsDate: "2020-01-01" ) - , isPresented: .constant(true) ) } }