Hi!
I created this github sample project to describe an issue with the Xcode 11 SwiftUI preview canvas pane (⌥ + ⌘ + return)
in combination with the Swift package.
It seems that SwiftUI preview is working only for source files in Sources/[target]
directory
(Package -> Sources -> TargetName
) ,
but not in subfolders (Package -> Sources -> TargetName -> Subfolder
) .
File \FeaturePackage\Sources\FeaturePackage\SampleButton.swift
- preview is working
File \FeaturePackage\Sources\FeaturePackage\Subfolder\SampleButton.swift
- Error:
NoBuildableEntriesError: active scheme does not build this file
Select a scheme that builds a target which contains the current file, or add this file to a target that is built by the current scheme.
I know this is the forum about Swift language, not Xcode. But the described issue started to appear when we switched from framework to Swift Package.