After refactoring the code to meet the pattern MVVM (Chapter 11) I noticed that preview stopped working. This feature is kind of neat because it speeds up SwiftUI development and now, at this point, the only way to check how the user interface looks like is by running the simulator.
The error that is happening is described by Xcode as:
Failed to build ChecklistView.swift
Compiling failed: ‘ContentView_Previews’ is not a member type of ‘Checklist’
After a bit of searching I found: FB7370352: SwiftUI preview crashes when product module name is same as class from Foundation/UIKit · Issue #52 · feedback-assistant/reports · GitHub
I tested it and seems to fix the problem but… I wonder if the authors are aware of this issue. Do they know or suggest a proper way to fix it?
Thank you much for the help.