In Xcode 11 Beta 6, there is a known issue and workaround for views that do not have their certain flags set (see below).
If this applies to you, and you are unable to set the corresponding flags, you may need to remove the #if debug
flag around ContentView_Previews
until the issue is fixed in a future Xcode release.
See the Xcode 11 Beta 6 Release Notes:
Preview providers that are defined in projects which don’t have -DDEBUG
set for OTHER_SWIFT_FLAGS
and wrapped in #if DEBUG
don’t display in the canvas. That happens, for example, in Objective-C apps which that never had occasion to specify OTHER_SWIFT_FLAGS
. (51138834)
Workaround: Remove the #if DEBUG
and #endif
from around the PreviewProvider
declaration.