Created
October 19, 2020 20:02
-
-
Save mitnick78/5528ef48b8b349c43718feb9cf22a9a5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import SwiftUI | |
| struct NewView: View { | |
| @State var showSetting = false | |
| //MARK: Properties | |
| @ObservedObject var session = ActivityModelFirebase() | |
| var body: some View { | |
| NavigationView{ | |
| ScrollView { | |
| ForEach(self.session.activities){ a in | |
| ListRowView(activity: a) | |
| } | |
| } | |
| .navigationTitle("Actus") | |
| .navigationBarItems(trailing: Button(action: { | |
| self.showSetting.toggle() | |
| }, label: { | |
| Image(systemName: "slider.horizontal.3") | |
| .foregroundColor(.black) | |
| .font(Font.system(size: 30)) | |
| }).fullScreenCover(isPresented: $showSetting, content: { | |
| SettingView() | |
| })) | |
| }.onAppear(perform: { | |
| getActivities() | |
| }) | |
| } | |
| func getActivities() { | |
| ActivityModelFirebase().getActivities() | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment