"Modern" NSWindow programming guide?

Does anyone know of any good guides or tutorials for NSWindow/NSDocument programming which cover modern API features like tabbing and accessory view controllers?


I have an app I'm working on that needs some TLC to really shine with these new features and I'm somewhat at a loss, as the API docs don't really describe how to use these features in combination to achieve anything real.


The relevant features of my app that I'm trying to make work:


  • Operates primarily on a "Project" file which is an NSDocument subclass, and a package of (mostly) opaque internal NSDocument subclasses
  • Individual files within the Project package can be opened in separate tabs within the same project window
  • Project windows display a custom titlebar containing relevant controls/information (similar to Xcode or Safari)


What I have sort of working is:


  • Open a Project file... I can get the window title bar to show either:
    • the standard proxy-icon/filename of the project file
    • the name of the current document (but no proxy-icon)
  • Auto-tabbing for opening multiple files in the same Project, but:

    The tab display name for the active tab replaces the Project display name for the window titlebar proxy icon, which is confusing, because:

    • if you were to drag that proxy icon, you would get the whole project, not just the active sub-document
    • the display name shows up twice, once on the tab, once on the window titlebar
  • Titlebar Accessory View controllers displaying the relevant window controls, but only just below the standard titlebar & stoplight, not in-line with them.


It's hard to describe, but there's a lot of how this is currently working that feels wrong... so I'm sure I'm not doing something right.


All the programming guides & tutorials I've been able to find on NSWindow & NSDocument seem to predate the auto-tabbing and rich accessory views features recently introduced.


Anyone have any pointers?

Accepted Reply

Seen these 2016 WWDC session videos?


What's New in Cocoa

https://developer.apple.com/videos/play/wwdc2016/203/


Crafting Modern Cocoa Apps

https://developer.apple.com/videos/play/wwdc2016/239/

Replies

Seen these 2016 WWDC session videos?


What's New in Cocoa

https://developer.apple.com/videos/play/wwdc2016/203/


Crafting Modern Cocoa Apps

https://developer.apple.com/videos/play/wwdc2016/239/