When displaying a popover:
struct ValueRowView<Content material: View, PopoverContent: View> : View
{
let label: String
let worth: Content material
@State personal var showPopover: Bool = false
let popoverContent: PopoverContent?
init(label: String, worth: Content material, @ViewBuilder popoverContent: () -> PopoverContent? = { nil })
{
self.label = label
self.worth = worth
self.popoverContent = popoverContent()
}
var physique: some View
{
HStack
{
VStack(alignment: .main)
{
Textual content(label)
.font(.footnote)
.foregroundColor(.grey)
worth
}
Spacer()
if let popoverContent
{
Button(motion:
{
showPopover.toggle()
})
{
Picture(systemName: "data.circle")
.foregroundColor(.accentColor)
}
.popover(isPresented: $showPopover, attachmentAnchor: .level(.heart))
{
ScrollView //TODO: Exhibits scroll indicator in popover arrow; iOS 26 bug?
{
popoverContent
.fixedSize(horizontal: false, vertical: true)
.padding()
.presentationCompactAdaptation(.popover)
}
.body(width: UIDevice.present.userInterfaceIdiom == .cellphone ? 270 : 400)
}
}
}
}
}
extension ValueRowView the place PopoverContent == EmptyView
{
init(label: String, worth: Content material)
{
self.label = label
self.worth = worth
self.popoverContent = nil
}
}
The scroll indicator is not seen subsequent to the scrolled content material. As an alternative it runs exterior the popover and reveals up on the popover arrow/triangle (see picture).
Methods to stop this?