Skip to content

Instantly share code, notes, and snippets.

@mitnick78
Created October 19, 2020 20:02
Show Gist options
  • Save mitnick78/5528ef48b8b349c43718feb9cf22a9a5 to your computer and use it in GitHub Desktop.
Save mitnick78/5528ef48b8b349c43718feb9cf22a9a5 to your computer and use it in GitHub Desktop.
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