I am trying to implement NSStackView
with always the same custom view. So I have define my xib file, linked everything inside my class, associated the class, ... but I am sure I am missing something because the content inside the view don't appear. Thx very much for your help.
The result when I run the below code:
My file is like :
class CustomView: NSView, NSTableViewDelegate, NSTableViewDataSource {
@IBOutlet weak var segmentControlOutlet: NSSegmentedControl!
@IBOutlet weak var tableViewOutlet: NSTableView!
}
class ViewController: NSViewController, NSStackViewDelegate {
@IBOutlet weak var stackViewOutlet: NSStackView!
override func viewDidLoad() {
super.viewDidLoad()
stackViewOutlet.delegate = self
let newView = CustomView()
stackViewOutlet.addArrangedSubview(newView)
}
override var representedObject: Any? {
didSet {
// Update the view, if already loaded.
}
}
}