Вы, похоже, не перебираете viewDidAppear , который принадлежит вашему NSViewController , но вы добавляете новую функцию самостоятельно.
Попробуйте использовать:
override func viewDidAppear() {
// Though the default implementation does nothing as of now,
// it is always safe to have the call to the super function in place,
// in case you plan to add sub-classes in between.
super.viewDidAppear()
addDomain.window?.makeFirstResponder(addDomain)
}