A custom-designed reimplementation of the UIActionSheet control for iOS

Overview

TOActionSheet

TOActionSheet

Beerpay PayPal

TOActionSheet is an iOS UI control providing a modal prompt control, similar to UIActionSheet. Unlike UIActionSheet, it can be very heavily re-themed, and avoids the delegate model by using blocks for each button.

Features

  • Pre-defined light and dark themes.
  • Every colour is editable, and subscribes to UIAppearence.
  • A custom header view may be specified as the top element.
  • Plays a bubbly pop-up animation.
  • Button callback is provided via blocks.
  • Subscribes to sudden trait collection changes, such as split screen on iPad Air 2.

Technical Requirements

iOS 7.0 or above.

License

TOActionSheet is licensed under the MIT License, please see the LICENSE file. analytics

Comments
  • Added option for icons and content alignment

    Added option for icons and content alignment

    I added the option for icons and content alignment in the menu items. This adds three TOActionSheetContentStyles. TOActionSheetContentStyleDefault, TOActionSheetContentStyleLeft and TOActionSheetContentStyleRight.

    All this enables me, for example, to use a more pro-app like menu structure. Below is what it looks like: simulator screen shot jan 11 2017 10 17 42 pm

    opened by Sjoerdjanssenen 1
  • Added a dismiss block

    Added a dismiss block

    I added a dismiss block to TOActionSheet. This means you can, for example, disable the button that shows the action sheet and then reenable it when the view is dismissed by a tap on the background.

    opened by Sjoerdjanssenen 1
  • `TOActionSheet` pushes `navigationItem.titleView` up.

    `TOActionSheet` pushes `navigationItem.titleView` up.

    I have a UIView set as the title view of my UINavigationBar.

    self.titleView = [[UIView alloc] initWithFrame:CGRectMake(10, 0, self.view.frame.size.width-20, 30)];
    self.titleView.backgroundColor = [UIColor whiteColor];
    [self.titleView.layer setCornerRadius:5.0f];
    
    ...
    Adding some buttons to it
    ...
    
    self.navigationItem.titleView = self.titleView;
    

    I also use TOActionSheet, which is triggered by one of those buttons in the titleView. That's presented with the code below:

    - (IBAction)barButtonLeft:(id)sender {
        TOActionSheet *actionSheet = [[TOActionSheet alloc] init];
        actionSheet.title = @"What type of food do you like?";
        actionSheet.style = TOActionSheetStyleDark;
    
        for (int i = 0; i < [[self.restaurant foodTypes] count]; i++) {
            [actionSheet addButtonWithTitle:[[self.restaurant foodTypes] objectAtIndex:i] tappedBlock:^{
                [self selectedTypeFromExtension:[[self.restaurant foodTypes] objectAtIndex:i]];
            }];
        }
    
        UIBarButtonItem *button = (UIBarButtonItem *)sender;
    
        [actionSheet showFromView:button inView:self.view];
    }
    

    However, every time I press the button and the TOActionSheet appears, the titleView slides up against the status bar, whereas it was vertically centered before. I don't know what could be causing this. Any ideas?

    opened by Sjoerdjanssenen 0
  • Problem with button if title not setted

    Problem with button if title not setted

    Hello. I have installed TOActionSheet via CocoaPods

    With title (1 button + 1 Destructive button)

    OK

    let actionSheet = TOActionSheet(title: "Choose an action")!
    actionSheet.style = .light
    actionSheet.contentstyle = .default
    actionSheet.addButton(withTitle: "Rename", tappedBlock: { print("rename") })
    actionSheet.addDestructiveButton(withTitle: "Delete", tappedBlock: { print("delete") })
    actionSheet.show(from: sender, in: self.navigationController?.view)
    
    

    screen shot 2018-05-15 at 17 25 17

    Without title (1 button + 1 Destructive button)

    Not OK

    let actionSheet = TOActionSheet(style: .light)!
    actionSheet.contentstyle = .default
    actionSheet.addButton(withTitle: "Rename", tappedBlock: { print("rename") })
    actionSheet.addDestructiveButton(withTitle: "Delete", tappedBlock: { print("delete") })
    actionSheet.show(from: sender, in: self.navigationController?.view)
    

    screen shot 2018-05-15 at 17 24 02

    Without title (2 buttons + 1 Destructive button)

    OK

    actionSheet.contentstyle = .default
    actionSheet.addButton(withTitle: "Rename", tappedBlock: { print("rename") })
    actionSheet.addButton(withTitle: "Move", tappedBlock: { print("move") })
    actionSheet.addDestructiveButton(withTitle: "Delete", tappedBlock: { print("delete") })
    actionSheet.show(from: sender, in: self.navigationController?.view)
    

    screen shot 2018-05-15 at 17 32 36

    opened by kirillrybin 0
  • Wrong position of TOActionSheet view

    Wrong position of TOActionSheet view

    Hello. I have installed TOActionSheet via CocoaPods

    Swift code

    @IBAction func barButtonAction(_ sender: UIBarButtonItem) {
            let actionSheet = TOActionSheet(title: "Choose an action")!
            actionSheet.style = .light
            actionSheet.contentstyle = .default
             #actionSheet.addButton(withTitle: "Rename", tappedBlock: {
                print("rename")
            })
            actionSheet.addDestructiveButton(withTitle: "Delete", tappedBlock: {
                print("delete")
            })
            actionSheet.show(from: sender, in: self.navigationController?.view)
        }
    

    Result

    Bar Button Item is on the right side of navigation bar but actionsheet is on the left screen shot 2018-05-15 at 17 02 24

    opened by kirillrybin 0
Owner
Tim Oliver
Gamer. Developer. Geek. Senior Software Engineer at @Drivemode (prev. @Realm). Lover of writing iOS code and singer of bad karaoke. 日本語もオッケ〜
Tim Oliver
This is an iOS control for selecting a date using UIDatePicker in an UIAlertController like manner

RMDateSelectionViewController This framework allows you to select a date by presenting an action sheet. In addition, it allows you to add actions arro

Roland Moers 1.2k Dec 13, 2022
This is an iOS control for presenting any UIView in an UIAlertController like manner

RMActionController This framework allows you to present just any view as an action sheet. In addition, it allows you to add actions around the present

Roland Moers 542 Dec 5, 2022
This is an iOS control for selecting something using UIPickerView in an UIAlertController like manner

RMPickerViewController This framework allows you to pick something with a picker presented as an action sheet. In addition, it allows you to add actio

Roland Moers 382 Dec 19, 2022
Present a sheet ViewController easily and control ViewController height with pangesture

PanControllerHeight is designed to present a sheet ViewController easily and control ViewController height with pangesture.

null 2 May 3, 2022
An infinite scroll control implemented with two views.

LCCycleBanner An infinite scroll control implemented with two views. Requirements iOS 9.0+ Swift 4.0+ Programming in Objective-C? Try LCInfiniteScroll

LiuChang 3 Jun 13, 2022
Highly configurable iOS Alert Views with custom content views

NYAlertViewController NYAlertViewController is a replacement for UIAlertController/UIAlertView with support for content views and UI customization. Fe

Nealon Young 609 Nov 20, 2022
Custom alert View to iOS applications

A simple, easy and custom iOS UIAlertView written in Swift Malert came to facilitates custom alert views as UIAlertController. Malert allows you to pe

Vitor Mesquita 480 Oct 29, 2022
A simple custom popup dialog view for iOS written in Swift. Replaces UIAlertController alert style.

A simple custom popup dialog view for iOS written in Swift. Replaces UIAlertController alert style.

donggyu 5 Jan 26, 2022
A Swift library to design custom prompts with a great scope of options to choose from.

Installation CocoaPods Install with CocoaPods by adding the following to your Podfile: source 'https://github.com/CocoaPods/Specs.git' platform :ios,

Gabriel Alvarado 736 Nov 3, 2022
BottomSheet makes it easy to add custom bottom sheets to your SwiftUI apps.

BottomSheet About BottomSheet BottomSheet makes it easy to add custom bottom sheets to your SwiftUI apps. The result can look like this...or completel

Daniel Saidi 174 Jan 2, 2023
zekunyan 608 Dec 30, 2022
Action sheet allows including your custom views and buttons.

CustomizableActionSheet Action sheet allows including your custom views and buttons. Installation CocoaPods Edit your Podfile: pod 'CustomizableAction

Ryuta Kibe 191 Nov 26, 2021
NiceAlertView is a Swift framework that can increase time of development and show nice custom AlertsViews

NiceAlertView Nice and beautiful AlertView for your iOS project NiceAlertView is a Swift framework that can increase time of development and show nice

Daniel Beltrami 0 Nov 24, 2021
BeautyAlert - BeautyAlert provides alerts with custom shapes, colors, buttons

BeautyAlert helps you can easily design by determining the color, shape, and sha

chacha 17 Sep 8, 2022
SwiftEntryKit is a presentation library for iOS. It can be used to easily display overlays within your iOS apps.

SwiftEntryKit ?? Donations can be made here. Table of Contents Overview Features Example Project Example Project Installation Presets Playground Requi

Daniel Huri 6.1k Jan 4, 2023
An iOS library for SwiftUI to create draggable sheet experiences similar to iOS applications like Maps and Stocks.

An iOS library for SwiftUI to create draggable sheet experiences similar to iOS applications like Maps and Stocks.

Wouter 63 Jan 5, 2023
A colored alert view for your iOS.

日本語 KRAlertController KRAlertController is a beautiful and easy-to-use alert controller for your iOS written by Swift. Requirements iOS 10.0+ Xcode 10

K.R.Impedance 52 Jun 30, 2022
🍞 Loaf is a Swifty Framework for Easy iOS Toasts

Loaf ?? Inspired by Android's Toast, Loaf is a Swifty Framework for Easy iOS Toasts Usage From any view controller, a Loaf can be presented by calling

Mat Schmid 995 Dec 28, 2022
The easiest way to display highly customizable in app notification banners in iOS

Written in Swift 5 NotificationBanner is an extremely customizable and lightweight library that makes the task of displaying in app notification banne

Dalton Hinterscher 4.5k Jan 9, 2023