• Stars
    star
    1,538
  • Rank 30,420 (Top 0.6 %)
  • Language
    Swift
  • License
    MIT License
  • Created almost 7 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Sheeeeeeeeet is a Swift library for creating menus, custom action sheets, context menus etc.

Sheeeeeeeeet Logo

Version Swift 5.6 Swift UI MIT License Twitter: @danielsaidi Mastodon: @danielsaidi@mastodon.social

About Sheeeeeeeeet

Sheeeeeeeeet is a UIKit library that lets you create menus that can be presented as custom action sheets, context menus, alert controllers, or in any way you like.

The result can look like this or completely different:

Sheeeeeeeeet comes with many item types (standard items, buttons, titles, toggles, etc.) and can be extended with your own custom item types.

About this repository

Since I have personally moved over to SwiftUI, this repository is no longer under active development. I will however gladly merge any PRs that add value to it or fixes problems with new iOS versions.

Installation

Sheeeeeeeeet can be installed with the Swift Package Manager:

https://github.com/danielsaidi/Sheeeeeeeeet.git

or with CocoaPods:

pod Sheeeeeeeeet

If you prefer to not have external dependencies, you can also just copy the source code into your app.

Supported Platforms

Sheeeeeeeeet supports iOS 9 and later.

Getting Started

Creating a menu

With Sheeeeeeeeet, you start with 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)

The library has many built-in item types, e.g. buttons, select items, links, etc. A complete list can be found here.

You can also create your own custom item types by inheriting any of the existing ones. For instance, if you build a car rental app, you can create a car-specific item that takes a Car model.

You can even create your own menu types by subclassing Menu. This makes it possible to create app-specific menus that provide specific functionality, handle specific tasks, etc.

Presenting a menu as an action sheet

You can present menus as custom action sheets:

let sheet = menu.toActionSheet(...) { sheet, item in ... }
sheet.present(in: vc, from: view) { sheet, item in ...
    print("You selected \(item.title)")
}

You can find more information in this action sheet guide.

Adding a menu as a context menu

You can add menus as iOS 13 context menus to any view you like:

menu.addAsContextMenu(to: view) { sheet, item in ...
    print("You selected \(item.title)")
}

You can find more information in this context menu guide.

Presenting a menu as an alert controller

You can present menus as UIAlertControllers:

let delegate = menu.presentAsAlertController(in: self, from: view) { sheet, item in ...
    print("You selected \(item.title)")
}

You can find more information in this alert controller guide.

Demo Application

The demo demonstrates different menus and menu items, including subclassing and appearance adjustments. To try it out, just open and run the Sheeeeeeeeet project.

Support

You can sponsor this project on GitHub Sponsors or get in touch for paid support.

Contact me

Feel free to reach out if you have questions or if you want to contribute in any way:

License

Sheeeeeeeeet is available under the MIT license. See the LICENSE file for more info.

More Repositories

1

SwiftUIKit

SwiftUIKit contains additional functionality for SwiftUI.
Swift
911
star
2

RichTextKit

RichTextKit is a Swift SDK that helps you use rich text in Swift and SwiftUI.
Swift
910
star
3

OnboardingKit

Tutti is a Swift library that lets you create tutorial and hint-based onboarding.
Swift
376
star
4

DeckKit

DeckKit makes it easy to create deck-based apps in SwiftUI.
Swift
331
star
5

ScrollKit

ScrollKit is a SwiftUI library that adds powerful scrolling features to SwiftUI, such as offset tracking and sticky scroll view headers.
Swift
284
star
6

SystemNotification

SystemNotification is a SwiftUI library that lets you mimic the native iOS system notification. It supports extensive styling, custom views and can be used on all major Apple platforms.
Swift
205
star
7

BottomSheet

BottomSheet lets you add custom bottom sheets to your SwiftUI apps.
Swift
181
star
8

SwiftUIBlurView

This view is also part of SwiftUIKit: https://github.com/danielsaidi/SwiftUIKit
Swift
122
star
9

KeyboardKitSwiftUI

KeyboardKitSwiftUI contains SwiftUI add-ons to KeyboardKit
Swift
63
star
10

MockingKit

MockingKit is a Swift-based library that lets you mock protocols and classes. It lets you register function results, invoke and inspect method calls etc.
Swift
57
star
11

WebViewKit

WebViewKit adds a WebView to SwiftUI.
Swift
55
star
12

SwiftKit

SwiftKit adds extra functionality to the Swift programming language.
Swift
51
star
13

StoreKitPlus

StoreKitPlus contains additional functionality for working with StoreKit 2.
Swift
38
star
14

nextra

NExtra is a C# library with extended functionality for the .NET Framework.
C#
27
star
15

TagKit

TagKit makes it easy to create tag-based apps in SwiftUI.
Swift
26
star
16

osx

Setup OS X with Homebrew, Cask, Node, npm, Gulp and a lot of other goodies.
Shell
25
star
17

Cloney

Cloney is an open-source client application that lets you clone .NET solutions
C#
24
star
18

ApiKit

ApiKit is a Swift library that makes it easy to perform async api calls.
Swift
18
star
19

iExtra

iExtra contains a bunch of general functionality that I use in my apps.
Swift
17
star
20

PrintingKit

PrintingKit is a Swift-based SDK that helps you print in Swift and SwiftUI.
Swift
12
star
21

GoogleTranslateSwift

A micro framework for integrating with the Google Translate api
Swift
8
star
22

Vandelay

Vandelay is an iOS importer/exporter, written in Swift.
Swift
7
star
23

trySwiftTvApp

This repository contains the SwiftUI-based tvOS app for the try! Swift World tvOS workshop.
Swift
5
star
24

SwiftData

I can't wait anymore! Let's build a Swifty layer on top of Core Data! πŸ˜…
4
star
25

wwdc20

WWDC20 test projects
Swift
3
star
26

trySwiftColorKitProSource

This repository contains the closed-source library for the try! Swift World SPM workshop.
Ruby
3
star
27

trySwiftColorKit

This repository contains the open-source library for the try! Swift World SPM workshop.
Swift
2
star
28

wwdc21

WWDC21 test projects
Swift
2
star
29

QuartzPdfTest

A test project for writing attributed strings to a local PDF
Swift
2
star
30

QuickType

QuickSearch lets type into a searchable text fields by typing on the keyboard without first having to focus on the text field.
Swift
2
star
31

trySwiftColorKitPro

This repository contains the closed-source distribution package for the try! Swift World SPM workshop.
C
1
star
32

VandelayQr

VandelayQr adds QR code support to Vandelay.
Swift
1
star