NSViewControllerPresentation
Simple demo of NSViewController's present and dismiss methods, including custom NSViewControllerPresentationAnimator object
Install / Use
/learn @foundry/NSViewControllerPresentationREADME
NSViewControllerPresentation
A small demo of NSViewController's present and dismiss methods, including custom NSViewControllerPresentationAnimator object
Examples provided for the following methods:
– presentViewController:asPopoverRelativeToRect:ofView:preferredEdge:behavior:
– presentViewControllerAsModalWindow:
– presentViewControllerAsSheet:
– presentViewController:animator:
For comparison, behaviour is also be provided using NSStoryboardSegues:
"Popover", "Sheet" and "Modal" are built-in segues corresponding to the respective presentViewController: methods
"Custom" segue is similar to presentViewController:animator and expects a custom NSStoryboardSegue and custom animator object.
"Show" segue launches an NSViewController in a new window with no return-relationship (i.e. no presenting/presented relationship)
For the animator/custom example, a custom NSStoryboardSegue subclass is provided, alongside a custom object conforming to the NSViewControllerPresentationAnimator protocol.
These are shown in Objective-C and Swift versions for comparison. ~~Check the comment in MyCustomSwiftSegue - there's a Swift-only gotcha waiting to trip you up~~ (see also this [Stack Overflow question]( http://stackoverflow.com/questions/26876609/nsstoryboardsegue-sample-code-yosemite-storyboard?lq=1 question)).

Related Skills
node-connect
341.6kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
84.6kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
341.6kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
84.6kCommit, push, and open a PR
