osx - Adding the WebView to NSPopover doesn't show the WebView, just the NSView -
in appdelegate init() have
popover = nspopover() popover.behavior = .transient popover.contentviewcontroller = contentviewcontroller()
now in contentviewcontroller : nsviewcontroller
override func loadview() { view = nsview() view.translatesautoresizingmaskintoconstraints = false view.addconstraint(nslayoutconstraint( item: view, attribute: .width, relatedby: .equal, toitem: nil, attribute: .notanattribute, multiplier: 1.0, constant: 580)) view.addconstraint(nslayoutconstraint( item: view, attribute: .height, relatedby: .equal, toitem: nil, attribute: .notanattribute, multiplier: 1.0, constant: 425)) nsuserdefaults.standarduserdefaults().registerdefaults(["useragent": "tick mac app"]) let url = nsurl(string: tickextensionurl )! var request = nsurlrequest(url: url) var webview = webview(frame: view.bounds) webview.mainframe.loadrequest(request) view.addsubview(webview) }
as can see view appears not webview. doing wrong?
you have tell controller whats view add @ end of load view
self.view = view