Swiftpack.co -  Package - magesteve/SlamCocoaSpellBook
Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
magesteve/SlamCocoaSpellBook
Swift Package to provide Closure based functionality for Macintosh App Development (Cocoa).
.package(url: "https://github.com/magesteve/SlamCocoaSpellBook.git", from: "1.0.1")

SlamCocoaSpellBook

Swift macOS Xcode SPM MIT

Swift Package to provide Closure based functionality for Macintosh App Development (Cocoa).

Installation

Requirements

  • MacOS 10.15
  • Swift 5
  • Xcode 11

Repository

https://github.com/magesteve/SlamCocoaSpellBook.git

Components

SlamButton Magic

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 Magic

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 Magic

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 Magic

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 Spell Magic

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.

Demo App

Sample code using this SpellBook can be found in the open-source Cocoa App CocoaGrimoire. Other SpellBooks by the author are also demonstrated there.

License

SlamCocoaSpellBook is available as open source under the terms of the MIT License.

GitHub

link
Stars: 0
Last commit: 2 weeks ago

Release Notes

Release 1.0.1
2 weeks ago

Release 1.0.1

Addition of NSStackView functions.

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco