Swift Package to provide Closure based functionality for Macintosh App Development (Cocoa).
https://github.com/magesteve/SlamCocoaSpellBook.git
SlamButton is a closure based version of standard NSButton. It supports the SlamActionable protocol, which can attaches a closure to the control. Pressing the button does not invoke a Target-Action, but instead executes the closure.
SlamTextField is a closure based version of NSTextField. It supports the SlamTextInputable protocol, which can attaches a closure to the field. Changing the text in the field invokes the closure.
SlamCheckbox & SlamSwitch are closures based version of CheckBox (NSButton) & NSSwitch. It supports the SlamSwitchable protocol, which can attaches two closures to the field. One closure returns the state of the control, while changing the state of the control invokes the other closure.
SlamTableView are closures based version of NSTableView, to draws Cell Base views (simple text contents). It supports either a closure to provide Array of Strings, or a set of closure to provide size of table (number of cells) & text content of each cell. Other clousure can be used to track the current selected cell.
NSStackView has extension to NSStackView for creating and filling vertical StackViews. For example, spellAddStandard adds a given view to the StackView, positioning it in the most common method. Future spells will add Slam views to the stack.
Sample code using this SpellBook can be found in the open-source Cocoa App CocoaGrimoire. Other SpellBooks by the author are also demonstrated there.
SlamCocoaSpellBook is available as open source under the terms of the MIT License.
link |
Stars: 0 |
Last commit: 3 years ago |
Release 1.0.1
Addition of NSStackView functions.
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics