I use a CNContactViewController
in a NSTabViewController
as well as a NSPopover
. In both cases the ViewController has a size that is too small (See red color in Screenshot).
The other tabs use all available space, like one would expect.
I tried to set the frame of the ViewController upon viewWillAppear
but this is ignored:
override func viewWillAppear() {
for i in tabViewItems{
if let vc = i.viewController as? CNContactViewController{
vc.contact = CNContact.dummyContact()
vc.view.frame = view.frame
vc.view.layer?.backgroundColor = NSColor.red.cgColor
view.layer?.backgroundColor = NSColor.green.cgColor
}
}
}
In a popover the height is the same:
Update
I do get this error when launching the app, however, I don't have access to the constraints on ABRemotePersonView
, so I am at a loss.
[133:9106090] [Layout] Detected missing constraints for
<ABRemotePersonView: 0x6080001411e0>
. It cannot be placed because there are not enough constraints to fully define the size and origin. Add the missing constraints, or settranslatesAutoresizingMaskIntoConstraints=YES
and constraints will be generated for you. If this view is laid out manually on macOS 10.12 and later, you may choose to not call[super layout]
from your override. Set a breakpoint onDETECTED_MISSING_CONSTRAINTS
to debug. This error will only be logged once.