Hi
I tried to caputre the hover event over a label as described from Apple in first link, I outlet for the label and added the gesture to it
and before that linked the gesture to a function, but I keep geting the error "Use of unresolved identifier UIHoverGestureRecognizer"
not sure why ? the simple demo is in dropbox link.
--
Kindest Regards
h ttps://developer.apple.com/documentation/uikit/uihovergesturerecognizer
h ttps://www.dropbox.com/s/c1tjrjtzmd6wk05/Gestures%20Demo.zip?dl=0
No, that works for me like this.
Could you send me the complete last project that does not work ?
Here is the code of the viewController
class ViewController: NSViewController {
@IBOutlet weak var label: LabelWithHelp!
fileprivate var labelTrackingArea : NSTrackingArea?
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
self.view.window?.isOpaque = false
if labelTrackingArea == nil {
labelTrackingArea = NSTrackingArea(rect: label.bounds, options: [NSTrackingArea.Options.mouseEnteredAndExited, NSTrackingArea.Options.cursorUpdate, NSTrackingArea.Options.activeInKeyWindow], owner: label, userInfo: nil)
label.addTrackingArea(labelTrackingArea!)
}
}
override var representedObject: Any? {
didSet {
// Update the view, if already loaded.
}
}
}