SwiftUI : How do you display a tooltip / hint on hover?
问题 how to display tooltip / hint on some view? As example, on the button. 回答1: SwiftUI 2.0 As simple as Button("Action") { } .help("Just do something") Button("Action") { } .help(Text("Just do something")) 回答2: Looks like there is really no native way to create a tooltip with SwiftUI 1. But here is a solution: import Foundation import SwiftUI public extension View { /// Overlays this view with a view that provides a Help Tag. func toolTip(_ toolTip: String) -> some View { self.overlay