Box

xib-based

Adding NSBox control to xib interface, change NSBox 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 box: HDBox = {
        let box = HDBox(frame: NSRect(x: 100, y: 100, width: 120, height: 100))
        return box
    }()
    
    override func viewDidLoad() {
        super.viewDidLoad()
        self.view.addSubview(box)
    }

}