How to load top level view from xib in macOS

Issue #171

var views: NSArray?
NSNib(nibNamed: NSNib.Name("ProfileView"), bundle: nil)?.instantiate(withOwner: nil, topLevelObjects: &views)
let profileView = views!.compactMap({ $0 as? ProfileView }).first!
Written by

I’m open source contributor, writer, speaker and product maker.

Start the conversation