Begin Editing on Insert
Your app is coming along nicely, but your users will complain, “Why do I have to double-click to start editing after an insert? It is obvious that I am going to immediately change the name of the new person. Can’t you start the editing as part of the insert?”
Oddly, this is a little tricky to do. Open Document.swift. First, add two new outlets:
class Document: NSDocument { @IBOutlet weak var tableView: NSTableView! @IBOutlet weak var arrayController: NSArrayController! var employees: [Employee] = [] {
Next, while still in Document.swift ...
Get Cocoa Programming for OS X: The Big Nerd Ranch Guide now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.