Post

Replies

Boosts

Views

Activity

Reply to How to show an overlay on hover?
Hi @sha921 , thanks for your input. However, I'm building a native visionOS app from ground up. I'm pretty sure onHover() and onContinuousHover() don't work on native visionOS apps. I'm not sure if it's a bug or delibarately done so for privacy reasons as I heard from multiple WWDC23 sessions that where user is looking at is detected at the system level not the app level. There is also no way to extend the HoverEffect to create my own. Basically what I would like to achive is to display an overlay above an image when the user is looking at it, and I found it's impossible. Below is an abstract code snippet. struct ImageView: View { @State private var isHovering = false var body: some View { someImage .onHover(perform: { hover in isHovering = hover }) .overlay(alignment: .bottom, content: { if isHovering { imageInfo } }) } }
Aug ’23