-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use TestDataTaskRepository in View Preview #2
Comments
Hi @cytrix86 - thanks for the kind words! To achieve this, you can change the struct TaskListView_Previews: PreviewProvider {
static var previews: some View {
let vm = TaskListViewModel()
vm.taskRepository = TestDataTaskRepository()
return TaskListView(taskListVM: vm)
}
} Hope this helps. Cheers, |
Hi Peter, Thanks for your help. It does not work instantly because of the change in the Tasks id for Firebase. I changed the test data accordingly:
I also tried to change the Resolver injection with and conditional Cheers, |
Hi,
first of all thanks for your great work. It is really a massive help for someone just starting with SwiftUI and Firebase.
I was looking for a solution to keep the TestDataTaskRepository providing the Data for the preview of the TaskListView so making changes to the cell still becomes visible while running the app uses the Firebase repository - as I am quite new to SwiftUI and especially Resolver if couldn't figure it out.
Thank you in advance.
Kind reagards
The text was updated successfully, but these errors were encountered: