Mercurial > public > lazybear
diff LazyBear/Views/Company/Helpers/NewsList.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 |
line wrap: on
line diff
--- a/LazyBear/Views/Company/Helpers/NewsList.swift Tue Jun 22 16:54:21 2021 +0200 +++ b/LazyBear/Views/Company/Helpers/NewsList.swift Tue Jun 22 19:56:59 2021 +0200 @@ -9,7 +9,7 @@ struct NewsList: View { var latestNews: [LatestNewsModel] - @Environment(\.presentationMode) private var newsListPresentation + @Binding var isPresented: Bool var body: some View { NavigationView { @@ -29,7 +29,7 @@ .navigationTitle("Latest news") .toolbar { ToolbarItem(placement: .cancellationAction) { - Button(action: { newsListPresentation.wrappedValue.dismiss() }) { + Button(action: { self.isPresented.toggle() }) { Image(systemName: "multiply") } } @@ -50,6 +50,7 @@ summary: "https://www.investing.com/news/stock-market-news", url: "https://cloud.iexapis.com/v1/news/article/99abeb99-6d9e-47c8-ae7b-53404eacccec") ] + , isPresented: .constant(true) ) } }