I can't seem to get my SwiftUI preview to work in a Swift Package created with the "Multiplatform Swift Package" Xcode 12 template. Does this feature require macOS 11+? I'm currently on Catalina with the Xcode 12 beta.
Here's what I get from the SwiftUI Preview Diagnostics on macOS:
and on iOS:
Here's what I get from the SwiftUI Preview Diagnostics on macOS:
Code Block HumanReadableNSError: connectToPreviewHost: Failed to connect to 2247: Error Domain=com.apple.dt.ProcessAttachUtilities Code=0 "Failed to get task for pid 2247: 0" UserInfo={NSLocalizedDescription=Failed to get task for pid 2247: 0} com.apple.dt.xcodepreviews.service (17):
and on iOS:
Code Block 'SwiftUIView_Previews' is not a member type of 'NoiseKit' ---------------------------------------- CompileDylibError: Failed to build SwiftUIView.swift Compiling failed: 'SwiftUIView_Previews' is not a member type of 'NoiseKit' /Users/rudedogg/Library/Developer/Xcode/DerivedData/NoiseKit-gefbuwplfdnsqkghveaurldpgavw/Build/Intermediates.noindex/Previews/NoiseKit/Intermediates.noindex/NoiseKit.build/Debug-appletvsimulator/NoiseKit.build/Objects-normal/x86_64/SwiftUIView.2.preview-thunk.swift:22:43: error: 'SwiftUIView_Previews' is not a member type of 'NoiseKit' typealias SwiftUIView_Previews = NoiseKit.SwiftUIView_Previews ~~~~~~~~ ^ /Volumes/Files/work/packages/NoiseKit/Sources/NoiseKit/NoiseKit.swift:1:8: note: 'NoiseKit' declared here struct NoiseKit { ^ /Users/rudedogg/Library/Developer/Xcode/DerivedData/NoiseKit-gefbuwplfdnsqkghveaurldpgavw/Build/Intermediates.noindex/Previews/NoiseKit/Intermediates.noindex/NoiseKit.build/Debug-appletvsimulator/NoiseKit.build/Objects-normal/x86_64/SwiftUIView.2.preview-thunk.swift:21:34: error: 'SwiftUIView' is not a member type of 'NoiseKit' typealias SwiftUIView = NoiseKit.SwiftUIView ~~~~~~~~ ^ /Volumes/Files/work/packages/NoiseKit/Sources/NoiseKit/NoiseKit.swift:1:8: note: 'NoiseKit' declared here struct NoiseKit { ^