I have a View with a DragGesture to resize something, so I tried using onHover to set the macOS cursor to the right resize icon. It doesn't work 100%, because the drag will reset the cursor. Then I have to move the pointer out of the view and back in, to re-trigger the onHover and get the resize cursor again.
Code Block swift private struct HeaderEdgeDragArea: View { var drag: some Gesture { DragGesture(minimumDistance: 0, coordinateSpace: .global) .onChanged { value in ... } .onEnded { _ in ... } } var body: some View { Color.gray.zIndex(2.0).frame(width: 1.0) .overlay( Rectangle().frame(width: 8) .foregroundColor(.clear) .contentShape(Rectangle()) .border(Color.red, width: 0.5) .onHover { hovering in print("hovering: \(hovering)") if hovering { NSCursor.resizeLeftRight.push() } else { NSCursor.pop() } } .gesture(drag) ) } }