Mercurial > public > lazybear
changeset 422:a38e8acccb85
Minor UI changes
author | Dennis Concepción Martín <66180929+denniscm190@users.noreply.github.com> |
---|---|
date | Sat, 12 Jun 2021 18:54:47 +0200 |
parents | 9b7af8e83d12 |
children | bdfdf3a1b34e |
files | LazyBear.xcodeproj/project.xcworkspace/xcuserdata/dennis.xcuserdatad/UserInterfaceState.xcuserstate LazyBear/Views/Home/HomeView.swift |
diffstat | 2 files changed, 12 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
Binary file LazyBear.xcodeproj/project.xcworkspace/xcuserdata/dennis.xcuserdatad/UserInterfaceState.xcuserstate has changed
--- a/LazyBear/Views/Home/HomeView.swift Sat Jun 12 15:20:04 2021 +0200 +++ b/LazyBear/Views/Home/HomeView.swift Sat Jun 12 18:54:47 2021 +0200 @@ -34,7 +34,7 @@ let mirror = Mirror(reflecting: lists) ForEach(Array(mirror.children), id: \.label) { child in if let list = child.value as? [String : QuoteModel] { - StockRow(listName: "\(child.label!)", list: list, intradayPrices: home.data.intradayPrices, addOnDelete: false) + StockRow(listName: "\(adaptListTitle(child.label!))", list: list, intradayPrices: home.data.intradayPrices, addOnDelete: false) .listRowInsets(EdgeInsets()) } } @@ -71,6 +71,17 @@ } } + + /* + Get list keys (mostactive, losers, active) and adapt them to diplay + */ + private func adaptListTitle(_ title: String) -> String { + if title == "mostactive" { + return "Most active" + } else { + return title.capitalized + } + } } struct HomeView_Previews: PreviewProvider {