Ribbon
A simple cross-platform toolbar/custom input accessory view library for iOS & macOS. Written in Swift.
Features
? Try: Includes an iOS & macOS demo.
- Provide items either programmatically or from a JSON configuration file.
- Dark mode.
- + more!
iOS
-
Supports push buttons—a segmented item's subitems become push buttons.
-
iOS 13: action items use the new context menu interaction:
<img src="https://raw.githubusercontent.com/chriszielinski/Ribbon/master/.readme-
macOS
- Supports push, action, & segmented control toolbar items.
- Provides
NSMenuItem
s for each item.
Requirements
- iOS 10.0+ (12.0+ for dark mode)
- macOS 10.12+ (10.13+ for full functionality)
Installation
Ribbon
is available for installation using Carthage or CocoaPods.
Carthage
CocoaPods
iOS 13
Building for iOS 13 requires Xcode 11 and modifying iOS13.xcconfig:
Usage
There are two ways of integrating Ribbon
into your project:
Configuration File
? The recommended approach.
The configuration file makes for a quick & easy integration. The default configuration filename is ribbon-configuration.json
and should be copied into the target's bundle resources (in the Copy Bundle Resources build phase).
The JSON below defines a single action item and toolbar configuration—which is only relevant for the macOS platform.
? See: Demos/Shared/ribbon-configuration.json for a more comprehensive example.
Integration into your view controller is as simple as:
? Note: The code below is an abstraction and will not compile.
Programmatically
? Note: The code below is an abstraction and will not compile.
// ToDo:
- [ ] Add documentation.
- [ ] Implement
UIKeyCommand
.