Mercurial > public > lazybear
comparison LazyBear/Views/Profile/ProfileView.swift @ 392:13f3578def61
Implement create watchlist
author | Dennis Concepción Martín <66180929+denniscm190@users.noreply.github.com> |
---|---|
date | Sat, 01 May 2021 13:11:32 +0200 |
parents | 8ec37b2baafd |
children | 0a4c399170c4 |
comparison
equal
deleted
inserted
replaced
391:8ec37b2baafd | 392:13f3578def61 |
---|---|
8 import SwiftUI | 8 import SwiftUI |
9 import CoreData | 9 import CoreData |
10 | 10 |
11 struct ProfileView: View { | 11 struct ProfileView: View { |
12 @ObservedObject var profile = Profile() | 12 @ObservedObject var profile = Profile() |
13 | |
14 @Environment(\.managedObjectContext) private var moc | |
13 @FetchRequest(entity: WatchlistCompany.entity(), sortDescriptors: []) | 15 @FetchRequest(entity: WatchlistCompany.entity(), sortDescriptors: []) |
14 var watchlistCompanies: FetchedResults<WatchlistCompany> | 16 var watchlistCompanies: FetchedResults<WatchlistCompany> |
15 | 17 |
16 @State private var showCreateNewWatchlist = false | 18 @State private var showCreateNewWatchlist = false |
17 | 19 |
46 Image(systemName: "plus") | 48 Image(systemName: "plus") |
47 } | 49 } |
48 } | 50 } |
49 } | 51 } |
50 } | 52 } |
51 .sheet(isPresented: $showCreateNewWatchlist) { | 53 .fullScreenCover(isPresented: $showCreateNewWatchlist) { |
52 CreateNewWatchlist() | 54 CreateNewWatchlist() |
55 .environment(\.managedObjectContext, self.moc) | |
53 } | 56 } |
54 } else { | 57 } else { |
55 ProgressView() | 58 ProgressView() |
56 .onAppear { prepareUrl(isInitRequest: true) } | 59 .onAppear { prepareUrl(isInitRequest: true) } |
57 } | 60 } |