Sheeeeeeeeet helps you create menus that can be used as context menus and action sheets. It comes with many item types (standard items, buttons, titles, toggles etc.) and can be extended with custom ones.
Sheeeeeeeeet action sheets can be styled to look just like a
UIAlertController or completely different. You can also customize how they are presented and dismissed.
Sheeeeeeeeet 3 contains many breaking changes, but once you understand the model changes, you will hopefully see the improvements it brings and be able to migrate your apps pretty easily. See this migration guide for help.
The easiest way to add Sheeeeeeeeet to your project in Xcode 11 is to use Swift Package Manager:
Sheeeeeeeeet to your app without a dependency manager, clone this repository, add
Sheeeeeeeeet.xcodeproj to your project and
Sheeeeeeeeet.framework as an embedded app binary and target dependency.
With Sheeeeeeeeet, you start off by creating a menu, like this:
let item1 = MenuItem(title: "Int", value: 1) let item2 = MenuItem(title: "Car", value: Car()) let button = OkButton(title: "OK") let items = [item1, item2, button] let menu = Menu(title: "Select a type", items: items)
There are many built-in menu item types, e.g. regular and selectable items, links, buttons, titles, collections, custom items etc. You find a complete list in this item guide.
Present the menu as an action sheet
You can present the menu as a custom action sheet or use it to create an action sheet, which you can then configure in any way you want, for instance:
menu.presentAsActionSheet(in: vc, from: view, action: ...)
Add the menu as a context menu
You can also add the menu as an iOS 13 context menu to any view you like, for instance:
let delegate = menu.addAsContextMenu(to: view, action: ...)
You can find more information in this context menu guide.
Present the menu as an alert controller
You can also present the menu as a
UIAlertController, for instance:
let delegate = menu.presentAsAlertController(in: self, from: view, action: ...)
You can find more information in [this alert controller guide][Alert-Controllers].
When you have the basics under control, check out this advanced example to see how you can take things further.
This repository contains a demo app that demonstrates different menus and menu items, including subclassing and appearance adjustments. To try it out, open and run the
Feel free to reach out if you have questions or if you want to contribute in any way:
Sheeeeeeeeet is available under the MIT license. See LICENSE file for more info.
Help us keep the lights on
3.0.3 - Oct 12, 2019
This version fixes some subtitle problems, where section titles and mutli select toggles didn't display their subtitles. It also fixes some behavior issues, where subtitles were incorrectly tinted.
3.0.2 - Oct 10, 2019
This version adjusts the popover height calculations to include the height of a visible header. This solves the problem where the popover content would always scroll when a header was used.
The version also adjusts the item height calculations, so that you no longer have to register a height for each item. This solves the problem with all items getting a zero size by default. Now,
height is recursively resolved to the closest parent height if you haven't overridden
appearance().height for your custom item.
3.0.1 - Oct 10, 2019
This version adjusts the subtitle style to use
subtitle instead of
It also adds a new
preferredActionSheetCellStyle property to
MenuItem, which you can override for your custom items.
3.0.0 - Sep 30, 2019
This version separates the menu data model from the custom action sheet implementation, so that you can create menus without caring about how they will be presented.
Menu type and all
MenuItem types are decoupled from the presentation. This means that you can use them in more ways, for instance in custom and native action sheets, context menus etc.
With these changes, you now create an
ActionSheet with a
Menu instead of with a list of
ActionSheetItem. Due to this, the
3.0 release of Sheeeeeeeeet has many breaking changes:
ActionSheetItemhave been replaced by the new
MenuItemtypes. Most of these items have the same name as the old ones, but without the
ActionSheetDangerButtoncorresponds to the new
ActionSheetCustomItemContentCellhas been moved and renamed to
ActionSheetCollectionItemContentCellhas been moved and renamed to
There are also some breaking changes that involve how you work with action sheets:
- Item heights are no longer static, but an action sheet cell appearance proxy property.
- The action sheet header behavior is now specified in a
ActionSheetCustomItem) has been made non-generic.
isCancelButtonis gone. Use type checking instead, e.g.
- The popover presenter now supports header views. It no longer hides the header by default.
Menucan be presented as a custom action sheet, without creating an
Menucan be used to create action sheets, which you then present and configure like before.
Menucan be added as an iOS 13 context menu to any view.
Menucan be presented as a native
Some of the presentations above require that all items in the menu can be represented in that context.
2.1.4 - Sep 25, 2019
This version makes Package use https references instead of ssh.