How can I make the date picker show the date and time that is now? Without clicking nothing, just at the beginning. I am very new in Cocoa, I would appreciate any orientation.
This is what I have done:
- I create a new project > OSX > Application > Cocoa Application
- Main.storyboard. Drag a Date Picker
- Ctrl + drag from date picker to ViewController.swift. I give it the name datePicker: @IBOutlet weak var datePicker: NSDatePicker!
[datePicker setDateValue:[NSDate new]];in viewdidLoad of View Controller - KaunteyadatePicker.dateValue = NSDate()would solve your problem. Please get your basics right. It is not very hard to map obj-c to swift - Kaunteya