I have an executable SwiftUI target in my swift package, and have run into this error also - Previews requires ENABLE_DEBUG_DYLIB=YES to be defined.
currently my package.swift has this:
.executableTarget(
name: "ColorPickerDemo",
dependencies: ["ColorPicker"],
path: "Sources/ColorPickerDemo",
swiftSettings: [
.enableUpcomingFeature("ApproachableConcurrency"),
.define("ENABLE_DEBUG_DYLIB")
],
linkerSettings: [
.unsafeFlags([
"-Xlinker", "-sectcreate",
"-Xlinker", "__TEXT",
"-Xlinker", "__info_plist",
"-Xlinker", "Sources/ColorPickerDemo/Info.plist",
]),
]
together with an info.plist for the executable, and the demo swiftui app can be launched.
Clearly that isn't enough for previews though.. Any ideas?
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags: