79728202

Date: 2025-08-07 07:32:56
Score: 1
Natty:
Report link

Here's a good workaround...

As far as to what is happening, I could only guess. I don't feel like spending a lot of time trying to figure it out either. I don't believe this is the intended usage of the popover. Popover to normally used to popover a different view, not itself. It's interesting the View Extension works ( in my shortened testing) ... and the modifier doesn't. Best of luck.



extension View {
  func popper ( _ isPresented: Binding < Bool > ) -> some View {
    Color.clear
      .popover  ( isPresented: isPresented ) { self  }
  }
}


#if DEBUG
struct DisplayAsPopoverModifier_Previews: PreviewProvider {
    static var previews: some View {
        VStack(spacing: 16) {
            Text("Title")
                .font(.largeTitle)

            Image(systemName: "star")
                .font(.largeTitle)
        }
        .popper1 ( .constant ( true ) )
    }
}
#endif
Reasons:
  • Contains signature (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Tim