Giter Site home page Giter Site logo

toactionsheet's Introduction

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

toactionsheet's People

Contributors

timoliver avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

toactionsheet's Issues

TOActionSheet

crashed on version 1.0.2
func dismissViewWithCompactAnimation
after line [self removeFromSuperview];

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

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

No callback to dismiss

No callback when user tap on background to dismiss action sheet. Please let me know If there is anyway to catch that event.

Thank

Swift Integration

Looks very promising... Any way you could provide Swift code sample for it? Thanks

`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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.