I have created an NSTrackingArea
and I am passing a Dictionary in the userInfo
argument.
let trackingData = ["section": 1, "sectionRow": 12, "done": false]
let trackingArea = NSTrackingArea(
rect: cellView.bounds,
options: [NSTrackingAreaOptions.MouseEnteredAndExited, NSTrackingAreaOptions.ActiveAlways],
owner: self,
userInfo: trackingData as? [String : AnyObject])
cellView.addTrackingArea(trackingArea)
This event is successfully received here;
override func mouseEntered(event: NSEvent) {
print("Mouse Entered \(event.userData)")
}
How can I read the values for section etc from userData?