Greetings...
I am trying to use @Namespace for my matchedGeometryEffect use case.
prior to Xcode 15 beta the following code worked just fine:
struct ChapterItem_Previews: PreviewProvider {
@Namespace static var namespace
static var previews: some View {
ChapterItem(namespace: namespace, show: .constant(true))
}
}
However trying to do the same within the new Xcode 15 beta #Preview Macro
#Preview {
@Namespace var namespace
ChapterItem(namespace: namespace, show: .constant(true))
}
produces the following error message:
Ambiguous use of 'Preview(_:traits:body:)'
May I kindly get assistance on the proper way I can get this to work in Xcode 15 beta?
Please be as detail as you can since I'm still new to swiftUI as well Thank You.
Discuss the WWDC23 Session Build programmatic UI with Xcode Previews
RSS for tagBuild programmatic UI with Xcode Previews
Posts under wwdc2023-10252 tag
2 Posts
Sort by:
Post
Replies
Boosts
Views
Activity
I am not able to present the preview of xcode 15,
I am having the error message "Cannot preview in this file" "Syntax error" but I have no error in xcode.