Xcode 15 beta 2 - SampleTrip preview does not compile

I got the errors like Type 'Trip' has no member 'preview', but the preview is defined in Trip.swift comment all preview code with errors and the project can be compiled.

Answered by twalters in 757108022

Not sure if you submitted the feedback, but the workaround for the moment is in the release notes.

#Preview can’t reference symbols in Swift type extensions when they are defined in the same module as the Preview (110671628)

Workaround: Revert to using PreviewProvider, or copy the implementation of the extension directly in to the #Preview itself or make it a global symbol

Hi,

Sorry to hear you are having problems getting previews working. There are not enough details here to help you diagnose, so the best next step will be to file a feedback with diagnostics so we can take a look. We will need the diagnostics Xcode Previews generates in order to make sure we understand the error the previews system is encountering.

  1. Download and install the logging profile on all devices involved. Instructions and profiles are available here: https://developer.apple.com/bug-reporting/profiles-and-logs/?name=swift
  2. Reproduce the issue
  3. Click the "Diagnostics" button in the error banner in Previews' Canvas area (or if the banner is missing you can use the menu: Editor > Canvas > Diagnostics)
  4. In the sheet that appears, click "Generate Report" in the bottom left of the sheet
  5. Attach (or make from the folder) the resulting zip file to the bug (will be named something like previews-diagnostics-0123456789.zip)
  6. Generate the sysdiagnose(s) and attach those too
Accepted Answer

Not sure if you submitted the feedback, but the workaround for the moment is in the release notes.

#Preview can’t reference symbols in Swift type extensions when they are defined in the same module as the Preview (110671628)

Workaround: Revert to using PreviewProvider, or copy the implementation of the extension directly in to the #Preview itself or make it a global symbol

Xcode 15 beta 2 - SampleTrip preview does not compile
 
 
Q