Swift Package of useful tools for Macintosh App development (Cocoa).
Refer to inline documentation for explanation for specific calls.
Typealiases for Closures.
For example, ImageClosure is a typealais for a Closure that has no results, but it passed a NSImage.
Extensions to the abstract structure CocoaSpellBook containing various Human Readable constants (using NSLocalizedString) and computed constants (reading from plist.info file).
Extensions to the abstract structure CocoaSpellBook to easily manage Save & Open Panels. Some of the calls require Closures that will be invoked with the specific information (URL, Data, etc.), assuming the user has entered the correct information.
For example, saveFile(data:,type:) is a function that displays a save panel to save given data as given file type. If new file is referenced, data is saved to that file.
Extensions to the abstract structure CocoaSpellBook to open item external to the source code (URLs, embeded Files, Help manager).
For example, openURL() is a function that is passed an URL, and invokes it (usually opening Safari).
Extensions to the abstract structure CocoaSpellBook providing NSDocumentController function including open document & new document. Some of the function can be modified using the associated changable closure variable.
Extensions to the abstract structure CocoaSpellBook to provide standard Alerts (message, yes/no, Are you sure) and processing of modal windows.
Custom NSView subclass SpellColorBackgroundView fills the view with either with either specified NSColor, or using the Aqua safe colors controlBackgroundColor or unemphasizedSelectedContentBackgroundColor. The important fields are Inspectable by Interface Builder.
Sample code using this SpellBook can be found in the open-source Cocoa App CocoaGrimoire. Other SpellBooks by the author are also demonstrated there.
CocoaSpellBook is available as open source under the terms of the MIT License.