Hi,
Sorry to hear you are having problems getting previews working.
The PreviewProvider code teaches the preview machinery how to instantiate your View in isolation rather than in the context of your fall app UI (imagine the PreviewProvider creates just a single cell of your table view). To generate the preview it has to run in some UI context, and very frequently developer's rely on a lot of their other app code for the preview's types and model) so generally that means using your real app as its rendering environment.
All that said, your description of what is happening makes me think that your app is crashing when attempting to generate the preview.
Crash logs for the preview app will show up in ~/Library/Logs/DiagnosticReports/. It can sometimes take a few minutes for it to generate, so give it a bit time and then see if any are there. Hopefully that will give you some helpful hints on what is causing the crash.
If that still doesn't resolve issue then probably best next step will be to file a feedback with diagnostics.
We will need the diagnostics Xcode Previews generates in order to make sure we understand the error the previews system is encountering.
- When you get an error in Xcode Previews, an error banner appears in the canvas
- Click the "Diagnostics" button in that banner
- In the sheet that appears, click "Generate Report" in the bottom left of the sheet
- Attach (or make from the folder) the resulting zip file to the bug (will be named something like
previews-diagnostics-0123456789.zip
)