2

How can I set a doubleClick event in an NSDatePicker and make doubleClick change its selected date the same as click does?

let doubleClick = NSClickGestureRecognizer(target: self, action: #selector(doubleClickEvent))
doubleClick.numberOfClicksRequired = 2
uploadDatePicker.addGestureRecognizer(doubleClick)  

I add this ClickGestureRecognizer for my DatePicker. When I double clicked in the DatePicker, it can correctly get into the function doubleClickEvent but the selected date didn't change.

How should I code to make the DatePicker change its selected date when user double click any date?

rmaddy
  • 314,917
  • 42
  • 532
  • 579
stephanie
  • 21
  • 3
  • Show the obj doubleClickEvent function + the name of the class under which you are writing code. – El Tomato Aug 14 '19 at 07:06
  • Double click does change the date if you remove the click recognizer. See [Double-click action for menu bar icon in Mac OSX](https://stackoverflow.com/a/47031117/4244136) – Willeke Aug 14 '19 at 10:08

0 Answers0