From c465063fa92e150e39d782ea02a299d6513c8079 Mon Sep 17 00:00:00 2001 From: Zach Nelson Date: Mon, 23 Nov 2026 12:30:52 -0600 Subject: [PATCH] Document utilities with DocC --- CHANGELOG.md | 2 +- CoreZen/Categories/NSFileManager+CoreZen.h | 12 ++- CoreZen/Categories/NSNumber+CoreZen.h | 3 + CoreZen/Categories/NSURL+CoreZen.h | 36 ++++++--- CoreZen/Categories/NSView+CoreZen.h | 6 ++ CoreZen/CoreZen.docc/CoreZen.md | 6 ++ CoreZen/CoreZen.docc/Utilities.md | 73 +++++++++++++++++ CoreZen/CoreZen.docc/ZENNode.md | 49 ++++++++++++ CoreZen/Node/Node.h | 80 +++++++++++++++++-- .../Preferences/PreferenceViewController.h | 8 +- .../Preferences/PreferencesWindowController.h | 13 +++ CoreZen/Queue/WorkQueue.h | 64 ++++++++++++--- CoreZen/Views/ArchivedView.h | 29 ++++++- 13 files changed, 343 insertions(+), 38 deletions(-) create mode 100644 CoreZen/CoreZen.docc/Utilities.md create mode 100644 CoreZen/CoreZen.docc/ZENNode.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 910ea9d..fa51179 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ To note a change, add a line under Unreleased, in a group such as Added, Changed ### Added -- Documentation for the persistence and media APIs, built with DocC: doc comments in their headers, which Xcode shows in Quick Help, and an article with examples for each. +- Documentation for the whole API, built with DocC: doc comments in the public headers, which Xcode shows in Quick Help, and an article with examples for each of CoreZen's three parts: persistence, media and utilities. ## 0.1.0 - 2026-11-19 diff --git a/CoreZen/Categories/NSFileManager+CoreZen.h b/CoreZen/Categories/NSFileManager+CoreZen.h index 15b8f98..60e506d 100644 --- a/CoreZen/Categories/NSFileManager+CoreZen.h +++ b/CoreZen/Categories/NSFileManager+CoreZen.h @@ -11,16 +11,24 @@ NS_ASSUME_NONNULL_BEGIN @interface NSFileManager (CoreZen) -// nil, with outError set, if the directory can't be found or created +/// Finds a standard folder, such as Application Support, with a path component +/// appended if one is given, and creates it if asked to. +/// +/// It returns nil, with the error set, if the folder can't be found or created. - (nullable NSURL *)zen_findOrCreateURLForDirectory:(NSSearchPathDirectory)searchPathDirectory inDomain:(NSSearchPathDomainMask)domain appendPathComponent:(nullable NSString *)appendComponent create:(BOOL)create error:(NSError *_Nullable *_Nullable)outError; +/// The app's own folder in the user's Application Support folder, named after +/// its executable, which this creates if there's none. +/// +/// It returns nil, and logs an error, if the folder can't be found or created. - (nullable NSURL *)zen_applicationSupportDirectory; -// nil if the main bundle doesn't name its executable +/// The name of the main bundle's executable, or nil if the bundle doesn't name +/// it. + (nullable NSString *)zen_executableName; @end diff --git a/CoreZen/Categories/NSNumber+CoreZen.h b/CoreZen/Categories/NSNumber+CoreZen.h index be4c032..8b4b75d 100644 --- a/CoreZen/Categories/NSNumber+CoreZen.h +++ b/CoreZen/Categories/NSNumber+CoreZen.h @@ -9,6 +9,9 @@ @interface NSNumber (CoreZen) +/// A random integer, from a cryptographically secure generator. +/// +/// It can be any `NSInteger` value, negative ones included. + (NSInteger)zen_randomInteger; @end diff --git a/CoreZen/Categories/NSURL+CoreZen.h b/CoreZen/Categories/NSURL+CoreZen.h index be28cf0..d70b64c 100644 --- a/CoreZen/Categories/NSURL+CoreZen.h +++ b/CoreZen/Categories/NSURL+CoreZen.h @@ -11,30 +11,46 @@ NS_ASSUME_NONNULL_BEGIN @interface NSURL (CoreZen) -// outVolumeName and outVolumeURL are required; outVolumeUUID and outError may be NULL +/// Gets the name, URL and UUID of the volume this URL is on. +/// +/// The name and URL pointers are required; the UUID and error pointers may be +/// NULL. It returns NO, with the error set, if the volume's details can't be +/// read. The UUID can be nil even when it returns YES, because some volumes, +/// like many network shares, have none. - (BOOL)zen_volumeName:(NSString *_Nullable *_Nonnull)outVolumeName volumeURL:(NSURL *_Nullable *_Nonnull)outVolumeURL volumeUUID:(NSUUID *_Nullable *_Nullable)outVolumeUUID error:(NSError *_Nullable *_Nullable)outError; +/// Finds the mounted volume with a UUID, and gets its name and URL. +/// +/// It returns NO if no mounted volume that isn't hidden has that UUID, or if +/// its details can't be read. + (BOOL)zen_volumeInfoForUUID:(NSUUID *)volumeUUID volumeName:(NSString *_Nullable *_Nonnull)outVolumeName volumeURL:(NSURL *_Nullable *_Nonnull)outVolumeURL; -// Path of url relative to this URL, or nil if url is neither this URL nor -// inside it. The result keeps the separator after this URL's path, e.g. -// /Volumes/Media to /Volumes/Media/Movies/a.mp4 gives @"/Movies/a.mp4". From -// the root URL "/" it has no leading separator, and for the same path it's @"". +/// The path of a URL relative to this one, or nil if the URL is neither this +/// one nor inside it. +/// +/// The result keeps the separator after this URL's path: /Volumes/Media to +/// /Volumes/Media/Movies/a.mp4 gives @"/Movies/a.mp4". From the root URL "/" it +/// has no leading separator, and for the same path it's @"". A path only counts +/// as inside this one at a separator, so /Volumes/Media2 isn't inside +/// /Volumes/Media. - (nullable NSString *)zen_relativePathToURL:(NSURL *)url; -// Inverse of zen_relativePathToURL:. Appends relativePath to this URL's path as -// a file system path, so a leading separator and characters like " ", "#" and -// "%" are taken literally, not as URL syntax. /Volumes/Media with -// @"/Movies/a.mp4" gives /Volumes/Media/Movies/a.mp4. Returns nil if this URL -// has no path or relativePath is nil. +/// Appends a relative path to this URL's path, undoing +/// `zen_relativePathToURL:`. +/// +/// The relative path is a file system path, so a leading separator and +/// characters like " ", "#" and "%" are taken literally, not as URL syntax. +/// /Volumes/Media with @"/Movies/a.mp4" gives /Volumes/Media/Movies/a.mp4. It +/// returns nil if this URL has no path, or the relative path is nil. - (nullable NSURL *)zen_URLByAppendingRelativePath:(nullable NSString *)relativePath isDirectory:(BOOL)isDirectory; +/// The size in bytes of the file at this URL, or 0 if it can't be read. - (NSUInteger)zen_fileSize; @end diff --git a/CoreZen/Categories/NSView+CoreZen.h b/CoreZen/Categories/NSView+CoreZen.h index 2c963cc..c9109f5 100644 --- a/CoreZen/Categories/NSView+CoreZen.h +++ b/CoreZen/Categories/NSView+CoreZen.h @@ -11,6 +11,12 @@ NS_ASSUME_NONNULL_BEGIN @interface NSView (CoreZen) +/// Adds constraints that make a subview fill this view. +/// +/// They tie the subview's left and top edges, width and height to this view's. +/// The subview's autoresizing mask would add constraints that conflict with +/// these, so a subview made in code needs +/// `translatesAutoresizingMaskIntoConstraints` set to NO. - (void)zen_addConstraintsForEqualSizes:(NSView *)other; @end diff --git a/CoreZen/CoreZen.docc/CoreZen.md b/CoreZen/CoreZen.docc/CoreZen.md index c9a3a37..f580da0 100755 --- a/CoreZen/CoreZen.docc/CoreZen.md +++ b/CoreZen/CoreZen.docc/CoreZen.md @@ -18,3 +18,9 @@ CoreZen's [README](https://github.com/znelson/CoreZen#readme) says how to get it - - +- + +### Framework Version + +- ``CoreZenVersionNumber`` +- ``CoreZenVersionString`` diff --git a/CoreZen/CoreZen.docc/Utilities.md b/CoreZen/CoreZen.docc/Utilities.md new file mode 100644 index 0000000..e5d1718 --- /dev/null +++ b/CoreZen/CoreZen.docc/Utilities.md @@ -0,0 +1,73 @@ +# Utilities + +A work queue whose work can be canceled, a tree of nodes with sizes, a preferences window, views loaded from nibs, and additions to Foundation and AppKit classes. + +## Overview + +- ``ZENWorkQueue`` is a serial queue whose async work can be canceled, and which can be terminated. +- ``ZENNode`` is a tree of named nodes with sizes, where every node's size stays the total of its children's. +- ``ZENPreferencesWindowController`` is a preferences window with a toolbar item for each pane. +- ``ZENArchivedView-c.class`` is a view that loads its contents from a nib its subclass names. + +### Cancel Queued Work + +```objc +ZENWorkQueue *queue = [ZENWorkQueue workQueue:@"com.example.thumbnails"]; +ZENWorkQueueToken *work = [queue async:^(ZENWorkQueueToken *token) { + if (token.canceled) { + return; + } + // Do the work +}]; + +// If the work is no longer needed +[work cancel]; + +// Before the app quits +[queue terminate:^{ + // Runs once the work already queued has run +}]; +``` + +A block that's queued always runs, so it checks its token to learn whether it should skip its work. + +### Total Sizes in a Tree + +```objc +ZENNode *movies = [[ZENNode alloc] initWithName:@"Movies"]; +[movies addChildNode:[[ZENNode alloc] initWithName:@"a.mp4" size:700]]; +[movies addChildNode:[[ZENNode alloc] initWithName:@"b.mp4" size:300]]; +// movies.size is 1000 +``` + +### Foundation and AppKit Additions + +CoreZen adds methods, named with a `zen_` prefix, to a few Foundation and AppKit classes. Xcode's Quick Help shows their documentation, but they have no pages here, because Xcode's documentation build leaves out categories on other frameworks' classes. + +- term `NSURL`: `zen_volumeName:volumeURL:volumeUUID:error:` gets the name, URL and UUID of the volume a URL is on, and `zen_volumeInfoForUUID:volumeName:volumeURL:` finds a volume again by its UUID. Some volumes, like many network shares, have no UUID. `zen_relativePathToURL:` gives a URL's path relative to another URL, such as its volume's, and `zen_URLByAppendingRelativePath:isDirectory:` turns it back into a URL. `zen_fileSize` gives a file's size. +- term `NSFileManager`: `zen_findOrCreateURLForDirectory:inDomain:appendPathComponent:create:error:` finds or creates a standard folder, `zen_applicationSupportDirectory` gives the app's own folder in Application Support, and `zen_executableName` gives the name of the app's executable. +- term `NSView`: `zen_addConstraintsForEqualSizes:` makes a subview fill a view. +- term `NSNumber`: `zen_randomInteger` gives a random integer. + +## Topics + +### Work Queues + +- ``ZENWorkQueue`` +- ``ZENWorkQueueToken`` +- ``ZENWorkQueueBlock`` +- ``ZENWorkQueueCancelBlock`` + +### Trees + +- ``ZENNode`` + +### Preferences + +- ``ZENPreferencesWindowController`` +- ``ZENPreferenceViewController`` + +### Views + +- ``ZENArchivedView-c.class`` +- ``ZENArchivedView-c.protocol`` diff --git a/CoreZen/CoreZen.docc/ZENNode.md b/CoreZen/CoreZen.docc/ZENNode.md new file mode 100644 index 0000000..006bb6e --- /dev/null +++ b/CoreZen/CoreZen.docc/ZENNode.md @@ -0,0 +1,49 @@ +# ``ZENNode`` + +## Topics + +### Creating a Node + +- ``initWithName:`` +- ``initWithName:size:`` +- ``copyChildren:`` + +### Identifying a Node + +- ``nodeID`` +- ``name`` + +### Size + +- ``size`` +- ``resetSize`` + +### The Tree + +- ``parent`` +- ``children`` +- ``childCount`` +- ``isChildless`` +- ``rootNode`` +- ``countLeaves`` +- ``countChildrenAndDescendants`` + +### Adding and Removing Nodes + +- ``addChildNode:`` +- ``removeChildNode:`` + +### Enumerating Nodes + +- ``enumerateChildrenWithBlock:`` +- ``enumerateParentsWithBlock:`` +- ``enumerateDepthFirstUsingBlock:`` +- ``enumerateBreadthFirstUsingBlock:`` +- ``ZENNodeEnumerateBlock`` + +### Learning About Changes + +- ``childWasAdded:`` +- ``childWasRemoved:`` +- ``descendantWasAdded:`` +- ``descendantWasRemoved:`` diff --git a/CoreZen/Node/Node.h b/CoreZen/Node/Node.h index e136844..30c6e22 100644 --- a/CoreZen/Node/Node.h +++ b/CoreZen/Node/Node.h @@ -10,53 +10,119 @@ @class ZENNode; NS_ASSUME_NONNULL_BEGIN +/// A block called for each node an enumeration visits, with its place in the +/// order they're visited, from 0. +/// +/// Set `stop` to YES to end the enumeration. typedef void (^ZENNodeEnumerateBlock)(id node, NSUInteger index, BOOL *stop); +/// A node in a tree of named nodes with sizes. +/// +/// A leaf has its own size, and a node with children is as big as they are +/// together. Adding, removing and moving nodes keeps every total in the tree up +/// to date. A subclass can learn about changes below a node by overriding +/// ``childWasAdded:`` and the methods like it. Copying a node copies the nodes +/// below it too. @interface ZENNode : NSObject +/// A unique identifier, made with the node. A copy gets a new one. @property (nonatomic, readonly, strong) NSUUID *nodeID; +/// The node's name. @property (nonatomic, readonly, strong, nullable) NSString *name; -// A leaf's own size, from init. A node with children is as big as they are -// together, so a leaf's own size gives way when it gets its first child. Adding, -// removing and moving nodes keeps every total in the tree up to date. +/// The node's size: a leaf's own, or else the total of its children's. +/// +/// A leaf's own size comes from init. A node with children is as big as they +/// are together, so a leaf's own size gives way when it gets its first child. +/// Adding, removing and moving nodes keeps every total in the tree up to date. @property (nonatomic, readonly) NSInteger size; +/// The node's parent, or nil if it has none. @property (nonatomic, readonly, weak, nullable) ZENNode *parent; + +/// The node's children, in the order they were added. @property (nonatomic, readonly, strong) NSArray *children; + +/// The number of the node's children. @property (nonatomic, readonly) NSUInteger childCount; + +/// Whether the node has no children. @property (nonatomic, readonly) BOOL isChildless; +/// Makes a node with a name, and a size of 0. - (instancetype)initWithName:(nullable NSString *)name; + +/// Makes a node with a name and a size. - (instancetype)initWithName:(nullable NSString *)name size:(NSInteger)size; +/// The top of the node's tree: its highest ancestor, or the node itself if it +/// has no parent. - (id)rootNode; + +/// The number of leaves below the node. - (NSUInteger)countLeaves; + +/// The number of nodes below the node. - (NSUInteger)countChildrenAndDescendants; +/// Adds a node as the last child, moving it from its old parent if it has one. +/// +/// Adding one of the node's children again does nothing. - (void)addChildNode:(id)child; + +/// Removes a child, if it's one of the node's children. - (void)removeChildNode:(id)child; +/// Adds a copy of each of another node's children to this node. - (void)copyChildren:(id)node; -// For subclasses to override, calling super. They run after a child of this node, -// or a node deeper below it, is added or removed, when sizes are already updated. +/// Called after a child is added to this node. +/// +/// A subclass can override it, calling super. Sizes are already updated when +/// it's called. - (void)childWasAdded:(id)child; + +/// Called after a child is removed from this node. +/// +/// A subclass can override it, calling super. Sizes are already updated when +/// it's called. - (void)childWasRemoved:(id)child; +/// Called after a node is added deeper below this node, to one of its +/// descendants. +/// +/// A subclass can override it, calling super. Sizes are already updated when +/// it's called. - (void)descendantWasAdded:(id)descendant; + +/// Called after a node is removed from deeper below this node, from one of its +/// descendants. +/// +/// A subclass can override it, calling super. Sizes are already updated when +/// it's called. - (void)descendantWasRemoved:(id)descendant; -// Sets the size to the total of the children's sizes, and updates the ancestors' -// totals to match. On a leaf, this drops the size it was made with. +/// Sets the size to the total of the children's sizes, and updates the +/// ancestors' totals to match. +/// +/// On a leaf, this drops the size it was made with. - (void)resetSize; +/// Calls a block for each of the node's children, in order. - (void)enumerateChildrenWithBlock:(ZENNodeEnumerateBlock)block; + +/// Calls a block for each of the node's ancestors, from its parent up to the +/// top of the tree. - (void)enumerateParentsWithBlock:(ZENNodeEnumerateBlock)block; +/// Calls a block for every node below this one, depth first, visiting each node +/// after the nodes below it. - (void)enumerateDepthFirstUsingBlock:(ZENNodeEnumerateBlock)block; + +/// Calls a block for every node below this one, breadth first: the children, +/// then the grandchildren, and so on. - (void)enumerateBreadthFirstUsingBlock:(ZENNodeEnumerateBlock)block; @end diff --git a/CoreZen/Preferences/PreferenceViewController.h b/CoreZen/Preferences/PreferenceViewController.h index 0dd56d0..8fe064f 100644 --- a/CoreZen/Preferences/PreferenceViewController.h +++ b/CoreZen/Preferences/PreferenceViewController.h @@ -44,19 +44,21 @@ NS_ASSUME_NONNULL_BEGIN +/// A view controller that's a pane in a ``ZENPreferencesWindowController``. @protocol ZENPreferenceViewController -// UI display name for preference window +/// The pane's name, shown on its toolbar item and as the window's title. - (NSString *)preferenceDisplayName; -// Internal unique identifier for preference window +/// A unique identifier for the pane, which identifies its toolbar item. - (NSString *)preferenceIdentifier; -// Icon to display in the preferences window menu bar +/// The image on the pane's toolbar item. - (nullable NSImage *)preferenceIcon; @optional +/// The tool tip for the pane's toolbar item. - (nullable NSString *)preferenceToolTip; @end diff --git a/CoreZen/Preferences/PreferencesWindowController.h b/CoreZen/Preferences/PreferencesWindowController.h index d9d4cbe..aa1d601 100644 --- a/CoreZen/Preferences/PreferencesWindowController.h +++ b/CoreZen/Preferences/PreferencesWindowController.h @@ -44,11 +44,24 @@ NS_ASSUME_NONNULL_BEGIN +/// A preferences window with a toolbar item for each pane. +/// +/// Each pane is a view controller that conforms to +/// ``ZENPreferenceViewController``. Choosing a toolbar item shows its pane, and +/// resizes the window to fit the pane's view. It's adapted from +/// [CCNPreferencesWindowController](https://github.com/phranck/CCNPreferencesWindowController). @interface ZENPreferencesWindowController : NSWindowController +/// Sets the window's panes, in the order of their toolbar items. +/// +/// Each must be an `NSViewController` that conforms to +/// ``ZENPreferenceViewController``. - (void)setPreferenceViewControllers:(NSArray *)viewControllers; +/// Shows the window, with the first pane. - (void)showPreferencesWindow; + +/// Closes the window. - (void)dismissPreferencesWindow; @end diff --git a/CoreZen/Queue/WorkQueue.h b/CoreZen/Queue/WorkQueue.h index 3851e12..f183807 100644 --- a/CoreZen/Queue/WorkQueue.h +++ b/CoreZen/Queue/WorkQueue.h @@ -9,47 +9,89 @@ NS_ASSUME_NONNULL_BEGIN +/// A flag that work checks to learn whether it was canceled, or its queue +/// terminated. +/// +/// A token starts out not activated, and can be activated once, from any +/// thread. Canceling and terminating are other names for activating, so code +/// reads naturally whichever one the token stands for. @interface ZENWorkQueueToken : NSObject -// WorkQueueToken begins deactivated and becomeds activated -// Used to indicate a state like `canceled` or `terminated` +/// Whether the token has been activated. - (BOOL)activated; -// Synonyms for -activated +/// Whether the token has been activated, for a token that stands for canceling. - (BOOL)canceled; + +/// Whether the token has been activated, for a token that stands for +/// terminating. - (BOOL)terminated; -// Token can be activated only once +/// Activates the token, unless it's activated already. +/// +/// It returns YES if this call activated the token, and NO if it was activated +/// already. - (BOOL)activate; -// Synonyms for -activate +/// Activates the token, like ``activate``. - (BOOL)cancel; + +/// Activates the token, like ``activate``. - (BOOL)terminate; @end +/// A block that a work queue runs. typedef void (^ZENWorkQueueBlock)(void); + +/// A block that a work queue runs asynchronously, with a token that says +/// whether to skip its work. +/// +/// The token is activated if the work was canceled, or its queue terminated, +/// before the block ran. The block should check the token's +/// ``ZENWorkQueueToken/canceled``, and return without doing its work if it's YES. typedef void (^ZENWorkQueueCancelBlock)(ZENWorkQueueToken *canceled); +/// A serial queue whose work can be canceled, and which can be terminated. +/// +/// Blocks run one at a time, in the order they're queued. Async work comes with +/// a token to cancel it. Terminating the queue runs a last block once the work +/// already queued has run, and that work sees that it was canceled. Work queued +/// after that doesn't run. @interface ZENWorkQueue : NSObject +/// The queue's name, which debuggers and crash reports show for its thread. @property (nonatomic, strong, readonly) NSString *label; +/// Makes a work queue with a name. + (ZENWorkQueue *)workQueue:(NSString *)label; +/// Makes a work queue with a name and a quality of service. + (ZENWorkQueue *)workQueue:(NSString *)label qos:(dispatch_qos_class_t)qos; -// Return value indicates if `block` was called -// (Block will not be called if the queue has been terminated) +/// Runs a block on the queue, and waits for it to finish. +/// +/// It returns YES if the block ran, or NO if the queue has been terminated, in +/// which case the block doesn't run. Don't call it from a block running on the +/// same queue, which would wait forever. - (BOOL)sync:(ZENWorkQueueBlock)block; -// Returns a WorkQueueToken if the block was queued to run -// This token can be used to atomically flag the work as canceled -// The WorkQueueToken return value indicates if `block` will be called -// (Block will not be called if the queue has been terminated) +/// Queues a block to run asynchronously. +/// +/// It returns a token that cancels the work, or nil if the queue has been +/// terminated, in which case the block doesn't run. Once queued, the block +/// always runs, with a token that tells it whether the work was canceled or the +/// queue terminated in the meantime. - (nullable ZENWorkQueueToken *)async:(ZENWorkQueueCancelBlock)block; +/// Terminates the queue: runs a last block once the work already queued has +/// run, and waits for it. +/// +/// The work already queued sees that it was canceled, and calls after this +/// don't run their blocks. A second call logs that the queue was terminated +/// already, and runs its block right away, on the calling thread. Don't call it +/// from a block running on the same queue, which would wait forever. - (void)terminate:(ZENWorkQueueBlock)block; @end diff --git a/CoreZen/Views/ArchivedView.h b/CoreZen/Views/ArchivedView.h index c0f808f..263a736 100644 --- a/CoreZen/Views/ArchivedView.h +++ b/CoreZen/Views/ArchivedView.h @@ -9,24 +9,45 @@ NS_ASSUME_NONNULL_BEGIN +/// The methods of a view that loads its contents from a nib. @protocol ZENArchivedView -// Specifies the nib name - derived views MUST override +/// The name of the nib the view loads its contents from. +/// +/// A subclass must override it. The nib is in the bundle that contains the +/// subclass. - (NSString *)archivedViewName; -// Common init path for both -initWithFrame and -initWithCoder - derived -// view may override, just be sure to call this super impl first +/// Loads the view's nib, and fills the view with the nib's root view. +/// +/// Both `initWithFrame:` and `initWithCoder:` call it. A subclass can override +/// it to finish setting up, calling super first. - (void)setupCommon; -// rootView should be connected to the nib custom view in Interface Builder +/// The view from the nib that fills this view. +/// +/// The view is the nib's owner, so in Interface Builder, connect this outlet of +/// the File's Owner to the nib's top-level view. @property (nonatomic, strong, nullable) IBOutlet NSView *rootView; @end +/// A view that loads its contents from a nib its subclass names. +/// +/// A subclass names the nib with ``ZENArchivedView-c.protocol/archivedViewName``, +/// and the nib's top-level view fills the view. @interface ZENArchivedView : NSView +/// Loads the view's nib, and fills the view with the nib's root view. +/// +/// Both `initWithFrame:` and `initWithCoder:` call it. A subclass can override +/// it to finish setting up, calling super first. - (void)setupCommon; +/// The view from the nib that fills this view. +/// +/// The view is the nib's owner, so in Interface Builder, connect this outlet of +/// the File's Owner to the nib's top-level view. @property (nonatomic, strong, nullable) IBOutlet NSView *rootView; @end