Ribbon alternatives and similar libraries
Based on the "Keyboard" category.
Alternatively, view Ribbon alternatives based on common mentions on social networks and blogs.
-
IQKeyboardManager
Codeless drop-in universal library allows to prevent issues of keyboard sliding up and cover UITextField/UITextView. Neither need to write any code nor any setup required and much more. -
TPKeyboardAvoiding
A drop-in universal solution for moving text fields out of the way of the keyboard in iOS -
IHKeyboardAvoiding
IHKeyboardAvoiding is an elegant solution for keeping any UIView visible when the keyboard is being shown - no UIScrollView required! -
YYKeyboardManager
iOS utility class allows you to access keyboard view and track keyboard animation. -
Toolbar
Awesome autolayout Toolbar. Toolbar is a library for iOS. You can easily create chat InputBar. -
AutoKeyboardScrollView
AutoKeyboardScrollView is an UIScrollView subclass which makes showing and dismissing keyboard for UITextFields much easier. So called keyboard avoidance. -
RSKKeyboardAnimationObserver
DISCONTINUED. Showing / dismissing keyboard animation in simple UIViewController category.
InfluxDB - Purpose built for real-time analytics at any scale.
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of Ribbon or a related project?
README
Ribbon ๐
A simple cross-platform toolbar/custom input accessory view library for iOS & macOS. Written in Swift.
Looking for...
- A type-safe, XPC-available SourceKitten (SourceKit) interface with some sugar? Check out Sylvester ๐ผ.
- A Floating Action Button for macOS? Check out Fab. ๐๏ธ.
- An Expanding Bubble Text Field for macOS? Check out BubbleTextField ๐ฌ.
- An integrated spotlight-based onboarding and help library for macOS? Check out Enlighten ๐ก.
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:
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
github "chriszielinski/Ribbon"
CocoaPods
pod "Ribbon"
iOS 13
Building for iOS 13 requires Xcode 11 and modifying iOS13.xcconfig:
// Uncomment to build Ribbon for iOS 13.
//
// - Note: Requires Xcode 11.
SWIFT_ACTIVE_COMPILATION_CONDITIONS = $(inherited) IOS13
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.
{
"items": [
{
"action": "actionItemHandler",
"controlKind": "action",
"identifier": "action-item-identifier",
"imageName": "NSActionTemplate",
"keyEquivalent": "a",
"keyEquivalentModifier": ["command", "shift"],
"title": "Action Item",
"toolTip": "The action button's tool-tip.",
"subitems": [
{
"action": "firstActionSubitemHandler",
"identifier": "first-action-subitem",
"imageName": "hand.thumbsup",
"keyEquivalent": "1",
"keyEquivalentModifier": ["command"],
"title": "First Action Subitem",
"toolTip": "The first action's tool-tip."
},
{
"action": "secondActionSubitemHandler",
"identifier": "second-action-subitem",
"imageName": "hand.thumbsdown",
"keyEquivalent": "2",
"keyEquivalentModifier": ["command"],
"title": "Second Action Subitem",
"toolTip": "The second action's tool-tip."
}
]
}
],
"toolbar": {
"displayMode": "iconOnly",
"sizeMode": "regular",
"identifier": "toolbar-identifier",
"defaultItems" : ["NSToolbarFlexibleSpaceItem", "action-item-identifier"]
}
}
Integration into your view controller is as simple as:
๐ Note: The code below is an abstraction and will not compile.
import Ribbon
class YourViewController ... {
...
var ribbon: Ribbon!
override func viewDidLoad() {
ribbon = try! Ribbon.loadFromMainBundle(target: self)
#if canImport(UIKit)
textView.inputAccessoryView = ribbon
#endif
}
#if canImport(AppKit)
override func viewWillAppear() {
view.window?.toolbar = ribbon.toolbar
super.viewWillAppear()
}
#endif
@objc
func actionItemHandler() { }
@objc
func firstActionSubitemHandler() { }
@objc
func secondActionSubitemHandler() { }
}
Programmatically
๐ Note: The code below is an abstraction and will not compile.
import Ribbon
class YourViewController ... {
...
var ribbon: Ribbon!
override func viewDidLoad() {
let firstActionSubitem = RibbonItem(subItemTitle: "First Action Subitem")
firstActionSubitem.action = #selector(firstActionSubitemHandler)
let secondActionSubitem = RibbonItem(subItemTitle: "Second Action Subitem")
secondActionSubitem.action = #selector(secondActionSubitemHandler)
let actionItem = RibbonItem(controlKind: .action,
title: "Action Item",
subitems: [firstActionSubitem, secondActionSubitem])
actionItem.action = #selector(actionItemHandler)
ribbon = Ribbon(items: [actionItem], target: self)
#if canImport(UIKit)
textView.inputAccessoryView = ribbon
#endif
}
#if canImport(AppKit)
override func viewWillAppear() {
view.window?.toolbar = ribbon.toolbar
super.viewWillAppear()
}
#endif
@objc
func actionItemHandler() { }
@objc
func firstActionSubitemHandler() { }
@objc
func secondActionSubitemHandler() { }
}
// ToDo:
- [ ] Add documentation.
- [ ] Implement
UIKeyCommand
.
Community
- Found a bug? Open an issue.
- Feature idea?
Open an issue.Do it yourself & PR when done ๐ (or you can open an issue ๐). - Want to contribute? Submit a pull request.
Acknowledgements
- Based on Rudd Fawcett's
RFKeyboardToolbar
.
Contributors
- Chris Zielinski โ Original author.
Frameworks & Libraries
Ribbon
depends on the wonderful contributions of the Swift community, namely:
- realm/SwiftLint โ A tool to enforce Swift style and conventions.
License
Ribbon
is available under the MIT license, see the LICENSE file for more information.
*Note that all licence references and agreements mentioned in the Ribbon README section above
are relevant to that project's source code only.