We tested our iOS app on visionOS and found that the hover effect works on most of UIKit views, but it does not work on most of SwiftUI views.
SwiftUI views are used within UIHostingController.
I created a new project (Storyboard based iOS app) and displayed the following SwiftUI view in UIHostingController and found that the buttons in the List were highlighted, but not the standalone buttons.
struct SwiftUIView: View {
var body: some View {
List {
// This button has the hover effect.
Button {
print("Hello")
} label: {
Text("Hello")
}
}
// This button does't have the hover effect.
Button {
print("Hello")
} label: {
Text("Hello")
}
.hoverEffect()
}
}
Is there a way to highlight any SwiftUI view?
In case anyone else runs into this - this is a known issue currently. Please submit a bug report at https://feedbackassistant.apple.com and post the FB number here so that you can track the resolution of it as well.