Mercurial > public > lazybear
comparison LazyBear/Views/Profile/Helpers/WatchlistCreatorList.swift @ 394:4c90e5b18632
Fixes #46
author | Dennis Concepción Martín <66180929+denniscm190@users.noreply.github.com> |
---|---|
date | Fri, 07 May 2021 11:00:53 +0200 |
parents | 0a4c399170c4 |
children | 444ec927d62f |
comparison
equal
deleted
inserted
replaced
393:0a4c399170c4 | 394:4c90e5b18632 |
---|---|
11 @ObservedObject var watchlistCreatorClass: WatchlistCreatorClass | 11 @ObservedObject var watchlistCreatorClass: WatchlistCreatorClass |
12 @State private var searchedCompany = String() | 12 @State private var searchedCompany = String() |
13 @State private var companies = [SearchResponse]() | 13 @State private var companies = [SearchResponse]() |
14 | 14 |
15 @Environment(\.presentationMode) private var presentationMode | 15 @Environment(\.presentationMode) private var presentationMode |
16 @Environment(\.managedObjectContext) private var moc | |
16 | 17 |
17 var body: some View { | 18 var body: some View { |
18 NavigationView { | 19 NavigationView { |
19 VStack { | 20 VStack { |
20 WatchlistCreatorSearchBar(searchedCompany: $searchedCompany) | 21 WatchlistCreatorSearchBar(searchedCompany: $searchedCompany) |
21 | 22 |
22 List(companies, id: \.self) { company in | 23 List(companies, id: \.self) { company in |
23 WatchlistCreatorRow(company: company, presentationMode: presentationMode, watchlistCreatorClass: watchlistCreatorClass) | 24 WatchlistCreatorRow(company: company, presentationMode: presentationMode, watchlistCreatorClass: watchlistCreatorClass) |
25 .environment(\.managedObjectContext, self.moc) | |
24 } | 26 } |
25 } | 27 } |
26 .navigationTitle("Search") | 28 .navigationTitle("Search") |
27 .navigationBarTitleDisplayMode(.inline) | 29 .navigationBarTitleDisplayMode(.inline) |
28 .onChange(of: searchedCompany, perform: { searchedCompany in | 30 .onChange(of: searchedCompany, perform: { searchedCompany in |