Giter Club home page Giter Club logo

jgactionsheet's People

Contributors

jonasgessner avatar paynechu 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jgactionsheet's Issues

ActionSheet opens under TabBar

I have an application with a UITabBar and the ActionSheet opens under the TabBar.
I tried [self.tabBarController.view bringSubviewToFront:sheet]; .
The ActionSheet isn't very modal at that time.

Thanks for the work!

Actionview doesnt start from top.

When you have a lot of actions and it opens, it doesnt start from the top to show the title first. It starts from the middle. Is there a way to fix this? Attached is a screenshot:.
screenshot 2015-01-21 10 02 32

How do you detect which button is pressed?

Hi,

I noticed that the indexPath.row is always zero in the ButtonPressedBlock, how do I detect which button was pressed?

I notice your examples always do the same thing no matter what button is pressed:

[_simple setButtonPressedBlock:^(JGActionSheet *sheet, NSIndexPath *indexPath) {
[sheet dismissAnimated:YES];
}];

PS Im using ios8 ipad

Button tapped index?

Hi,

[sheet setButtonPressedBlock:^(JGActionSheet *sheet, NSIndexPath *indexPath) {

Is indexPath the buttonIndex ?
Just trying to evaluable before I download.

Not really clear.

Thanks,

Jules

Performance issues

Hi! This action sheet is amazing. But I have performance problems on my old iPhone 4 with iOS6 (while on 5S it runs smoothly of course). I use your example project to test and sheet scrolling is very laggy especially for sheet with several sections and many buttons.
I tried to disable layer shadows but without a luck.
Maybe you can advice how to increase performance? Thanks a lot!

Titles & Messages Retain

Having an issue with self retaining.

Specifically the title and messages retain and i get the self - retaining cycle error when presenting from a UITableViewRowAction.

I've followed the examples step by step but the title and messages retain. I've tried using __weak and __unsafe_unretained with the same results:

here tis the set up :

if (!actionSheet) {
    NSByteCountFormatter *sizeFormatter = [[NSByteCountFormatter alloc] init];
    sizeFormatter.countStyle = NSByteCountFormatterCountStyleFile;
    message = [NSString stringWithFormat:@"File size is %@", [sizeFormatter stringFromByteCount:filesize]]

    actionSheet = [[JGActionSheet alloc] initWithSections:@[[JGActionSheetSection sectionWithTitle:self.titleNum message:message buttonTitles:@[@"Export", @"Email"] buttonStyle:JGActionSheetButtonStyleDefault], [JGActionSheetSection sectionWithTitle:nil message:nil buttonTitles:@[@"Cancel"] buttonStyle:JGActionSheetButtonStyleCancel]]];

    actionSheet.delegate = self;

    actionSheet.insets = UIEdgeInsetsMake(20.0f, 0.0f, 0.0f, 0.0f);

    if (iPad) {
        [actionSheet setOutsidePressBlock:^(JGActionSheet *sheet) {
            [sheet dismissAnimated:YES];
        }];
    }

    __weak typeof(self) weakSelf = self;

    [actionSheet setButtonPressedBlock:^(JGActionSheet *sheet, NSIndexPath *indexPath) {
        [sheet dismissAnimated:YES];

        if (indexPath.section == 0 && indexPath.row == 0) {
            [weakSelf exportPublication];
        } else if (indexPath.section == 0 && indexPath.row == 1) {
            [weakSelf emailPublication];
        } else if (indexPath.section == 1 && indexPath.row == 0) {

        }
    }];

}

[actionSheet showInView:self.tabBarController.view animated:YES];

Every time i click on the UITableViewRowAction the title and message populate according to the cell but the next one i tap on it retains the first title and message I tapped on. All NSStrings have a weak property set.

Section Selection

Hello, for multiple sections how to determine the section and the value that was clciked? Or selected? Thanks for your guidance.

Crash when create a new JGActionSheetSection

I met a crash recently, and from the Fabric the detail is (iPhone 6s, iOS9.2.1):


Thread : Crashed: com.apple.main-thread
0  libobjc.A.dylib                0x1829edbd0 objc_msgSend + 16
1  Foundation                     0x183c428e4 -[NSObject(NSKeyValueObserverNotification) willChangeValueForKey:] + 324
2  QuartzCore                     0x185a5f374 CA::Layer::set_delegate(objc_object*) + 72
3  UIKit                          0x188062538 -[UIView _createLayerWithFrame:] + 580
4  UIKit                          0x188061ff8 UIViewCommonInitWithFrame + 688
5  UIKit                          0x188061ce8 -[UIView initWithFrame:] + 140
6  UIKit                          0x1880695b8 -[UILabel initWithFrame:] + 48
7  UIKit                          0x1881278d8 -[UIButtonLabel _initWithFrame:button:] + 104
8  UIKit                          0x18812778c -[UIButton _newLabelWithFrame:] + 92
9  UIKit                          0x18851f0f8 -[UIButton _setupTitleViewRequestingLayout:] + 104
10 UIKit                          0x188129304 -[UIButton titleLabel] + 48
11 XXXXXXXXXX                  0x100116728 -[JGActionSheetSection setButtonStyle:forButton:] (JGActionSheet.m:395)
12 XXXXXXXXXX                  0x1001169b4 -[JGActionSheetSection makeButtonWithTitle:style:] (JGActionSheet.m:414)
13 XXXXXXXXXX                  0x1001159e4 -[JGActionSheetSection initWithTitle:message:buttonTitles:buttonStyle:] (JGActionSheet.m:245)
14 XXXXXXXXXX                  0x100115568 +[JGActionSheetSection sectionWithTitle:message:buttonTitles:buttonStyle:] (JGActionSheet.m:202)
15 XXXXXXXXXX                 0x1000c092c -[ZZFileViewController p_importAction:] (ZZFileViewController.m:525)
16 UIKit                          0x188097e50 -[UIApplication sendAction:to:from:forEvent:] + 100
17 UIKit                          0x18821b4a4 -[UIBarButtonItem(UIInternal) _sendAction:withEvent:] + 168
18 UIKit                          0x188097e50 -[UIApplication sendAction:to:from:forEvent:] + 100
19 UIKit                          0x188097dcc -[UIControl sendAction:to:forEvent:] + 80
20 UIKit                          0x18807fa88 -[UIControl _sendActionsForEvents:withEvent:] + 416
21 UIKit                          0x18807fbd4 -[UIControl _sendActionsForEvents:withEvent:] + 748
22 UIKit                          0x1880976e4 -[UIControl touchesEnded:withEvent:] + 572
23 UIKit                          0x188097314 -[UIWindow _sendTouchesForEvent:] + 804
24 UIKit                          0x18808fe30 -[UIWindow sendEvent:] + 784
25 UIKit                          0x1880604cc -[UIApplication sendEvent:] + 248
26 UIKit                          0x18805e794 _UIApplicationHandleEventQueue + 5528
27 CoreFoundation                 0x183324efc __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
28 CoreFoundation                 0x183324990 __CFRunLoopDoSources0 + 540
29 CoreFoundation                 0x183322690 __CFRunLoopRun + 724
30 CoreFoundation                 0x183251680 CFRunLoopRunSpecific + 384
31 GraphicsServices               0x184760088 GSEventRunModal + 180
32 UIKit                          0x1880c8d90 UIApplicationMain + 204
33 XXXXXXXXXX                  0x1000dbee8 main (main.m:14)
34 libdispatch.dylib              0x182df28b8 (Missing)

It is crashed in the Main thread, and what I do is create a JGActionSheetSection. The crash seems to happen at

button.titleLabel.font = font;

button is released when label is set to button(right?). My Project enables ARC, and I can't find any memory problem. Could you take a look?

Wrong rotation size in iOS7

If i present the shh like this

[sheet showInView:AppDelegate.window animated:YES];

When i rotate the device it stays with a wrong size!

Dark UI

Is it possible to use dark backgrounds and buttons?

Screenshots

Hows about a screen shot with a uitextfield added ?

Pod can not be build when included in extension

I suggest to wrap [UIApplication sharedApplication] code in

#if !(defined(__has_feature) && __has_feature(attribute_availability_app_extension))
    [[UIApplication sharedApplication] beginIgnoringInteractionEvents];
#endif

Pin the Cancel button in the scrollview?

Hi,
Excellent class! I have been playing around a bit with it, and was wondering if it is possible to pin the Cancel button to the bottom of the screen. When you have a long list with items and scroll up, the Cancel button (at the bottom of the list) scrolls off the screen. I would like it to stay at the bottom. I tried to add a separate UIView for this, but I couldn't get it to work..
Any thoughts?
Thanks!

Dismiss on background tap

Thanks for amazing action sheet!
One question - is it possible to somehow enable sheet dismissing by tapping not only some button but background also?

Creating Full White Background

Like Instagram's action sheet, is it possible to edit this action sheet that so instead of clear borders around each section the background is just plain white. Same spacing with each button and section, just a full white background that extends from the bottom of the screen to above the first button index? How could I get this working?

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.