How to get parent splitviewcontroller from view(xib)

213 Views Asked by At

I'm currently able to achieve this with Storyboards using:

 var parentSplit : NSSplitViewController? {
    guard let splitVC = parent as? NSSplitViewController else { return nil }
    return splitVC
}

but it returns nil if I try it in a xib file. My view is a subview in a SplitView.

0

There are 0 best solutions below