1

In my example I have tableview

  @IBOutlet weak var tableview: NSTableView!

if for example the second textfield in line 2 "Dr" has the focus, I want to focus the first textfield in line 3 "tom" after a "tab"

I can do it "explicitly" row for row in the tableview like this:

tableview.view(atColumn: 0, row: 0, makeIfNecessary: true)?.subviews[1].nextKeyView = tableview.view(atColumn: 0, row: 1, makeIfNecessary: true)?.subviews[0]

but I think that´s very unelegant. Is there a better way to achieve this?

enter image description here enter image description here

mica
  • 3,898
  • 4
  • 34
  • 62

0 Answers0