title: SwiftUI Recognize mouse hover
body: <p>For UIKit on Mac Catalyst (and soon on iPadOS with trackpad support in iOS 13.4) we can use the <code>UIHoverGestureRecognizer</code> to listen for mouse hover event and adjust view accordingly. On AppKit on macOS there is the <code>NSTrackingArea</code> for tracking the mouse cursor. </p>
  
  <p>I can't seem to find a way to recognize the hover gesture in SwiftUI. In the <a href="https://developer.apple.com/documentation/swiftui/gestures" rel="nofollow noreferrer">Gestures</a> page of SwiftUI documentation there's only support for tap, long press, drag, magnification (zoom), and rotation. There is no indication of mouse hover. </p>
  
  <p>Anyone have a way to do that?</p>
  
  <p>The answer should preferably run natively on both iOS app (UIKit with <code>UIHostingController</code>) and macOS app (AppKit with <code>NSHostingController</code>)</p>