How to implement NSSplitViewDelegate methods in an NSSplitViewController subclass
How to implement NSSplitViewDelegate methods in an NSSplitViewController subclass
- Subject: How to implement NSSplitViewDelegate methods in an NSSplitViewController subclass
- From: Bill Cheeseman <email@hidden>
- Date: Fri, 07 Aug 2015 08:47:15 -0400
The header file comments in NSSplitViewController (introduced in OS X 10.10 Yosemite) state with respect to certain NSSplitViewDelegate methods that are "implemented" in NSSplitViewController that they "require a call to super if overriden [sic] by a subclass." How do I call super in an override of these delegate methods?
All I can think of is this, from my subclass of NSSplitViewController (written in Swift 2):
override func splitView(splitView: NSSplitView, canCollapseSubview subview: NSView) -> Bool {
super.splitView(splitView, canCollapseSubview: subview) // must call super
return subview == splitView.subviews[1]
}
But I don't understand why the fact that NSSplitViewController "implements" these delegate methods requires my override to call super, or what calling super accomplishes in this situation. As a result, I don't feel comfortable that this is the right way to do it. I wonder if this has something to do with the other problem I posted about a few minutes ago, namely, that double-clicking the divider does collapse the subview when I implement this and the related delegate methods, but it does not set the 'collapsed' property of NSSplitViewItem to true.
--
Bill Cheeseman - email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden