ComboBox
xib-based
Adding NSComboBox control to xib interface, change control custom class to component class name of your exported.
code-based
Declare lazy load variable in the controller class and add it to the view.
import Cocoa
class ViewController: NSViewController {
lazy var comboBox: HDComboBox = {
let comboBox = HDComboBox(frame: NSRect(x: 100, y: 100, width: 96, height: 24))
return comboBox
}()
override func viewDidLoad() {
super.viewDidLoad()
self.view.addSubview(comboBox)
}
}