Created
February 23, 2018 03:25
-
-
Save andreyrd/a79cd3207931911e834179a94204ace5 to your computer and use it in GitHub Desktop.
Doesn't work with Swift4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var topLevelObjects = NSArray() | |
Bundle.main.loadNibNamed(NSNib.Name("MyCustomView"), owner: self, topLevelObjects: &topLevelObjects) | |
let views = (topLevelObjects as Array).filter { $0 is NSView } | |
let content = views[0] as! NSView | |
content.frame = bounds | |
addSubview(content) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Errors out with:
Cannot pass immutable value as inout argument: implicit conversion from 'NSArray' to 'NSArray?' requires a temporary