Giter Site home page Giter Site logo

Comments (12)

skywinder avatar skywinder commented on July 18, 2024

@masterjox I got a message "This video is private." by your links.

from actionsheetpicker-3.0.

masterjox avatar masterjox commented on July 18, 2024

sorry.
try now.

from actionsheetpicker-3.0.

skywinder avatar skywinder commented on July 18, 2024

@masterjox I don't see any ActionSheetStringPicker's problems here.

Can you clarify, what the expected result and what the actual result?

Only difference that I see in these 2 video - is in the first one it performs next picker after first is is done.
It seems that something goes wrong outside of actionSheetPicker logic and that's why next one in not called.

from actionsheetpicker-3.0.

masterjox avatar masterjox commented on July 18, 2024

The expect result is when you open the first actionsheet and select one, get new data and show other action sheet with dates

in iphone 6 ios 8 the action sheet begin to show but automatically dismiss ( if you pause the video, in second 3, you can see the action sheet above the screen.

from actionsheetpicker-3.0.

skywinder avatar skywinder commented on July 18, 2024

Ok. I get it.
Try to set breakpoint in dismissPicker method and detect, what cause dismissing of the Picker the second time.

from actionsheetpicker-3.0.

masterjox avatar masterjox commented on July 18, 2024

in the code of github on class: ActionSheetPickerViewController.m

y put this code:

- (IBAction)selectABlock:(UIControl *)sender {
    ActionStringDoneBlock done = ^(ActionSheetStringPicker *picker, NSInteger selectedIndex, id selectedValue) {
        if ([sender respondsToSelector:@selector(setText:)]) {
            [sender performSelector:@selector(setText:) withObject:selectedValue];
        }
        [self second:sender];
    };
    ActionStringCancelBlock cancel = ^(ActionSheetStringPicker *picker) {
        NSLog(@"Block Picker Canceled");
    };
    NSArray *colors = @[@"Red", @"Green", @"Blue", @"Orange"];
    [ActionSheetStringPicker showPickerWithTitle:@"Select a Block" rows:colors initialSelection:0 doneBlock:done cancelBlock:cancel origin:sender];
}

- (void)second:(id)sender{
    ActionStringDoneBlock done = ^(ActionSheetStringPicker *picker, NSInteger selectedIndex, id selectedValue) {
        NSLog(@"a vers si sale");
    };
    ActionStringCancelBlock cancel = ^(ActionSheetStringPicker *picker) {
        NSLog(@"Block Picker Canceled");
    };
    NSArray *colors = @[@"Red", @"Green", @"Blue", @"Orange"];
    [ActionSheetStringPicker showPickerWithTitle:@"Select a Block" rows:colors initialSelection:0 doneBlock:done cancelBlock:cancel origin:sender];
}

instead of:

- (IBAction)selectABlock:(UIControl *)sender {
    ActionStringDoneBlock done = ^(ActionSheetStringPicker *picker, NSInteger selectedIndex, id selectedValue) {
        if ([sender respondsToSelector:@selector(setText:)]) {
            [sender performSelector:@selector(setText:) withObject:selectedValue];
        }
    };
    ActionStringCancelBlock cancel = ^(ActionSheetStringPicker *picker) {
        NSLog(@"Block Picker Canceled");
    };
    NSArray *colors = @[@"Red", @"Green", @"Blue", @"Orange"];
    [ActionSheetStringPicker showPickerWithTitle:@"Select a Block" rows:colors initialSelection:0 doneBlock:done cancelBlock:cancel origin:sender];
}

and you can see the error ( the second actionsheet not show)

from actionsheetpicker-3.0.

skywinder avatar skywinder commented on July 18, 2024

The problem that you try to show next picker before first is completely dismissed. And it cancelling presenting one more picker.
Just try to wait a 0.3 sec (duration of animation) seconds before activate next picker.

from actionsheetpicker-3.0.

lat233 avatar lat233 commented on July 18, 2024

I encounter the same problem.
Even though when I have only one picker, after some displayed-dimissed, the picker does not display again!
Why do we need to wait for a moment before activate next picker on iphone 6 but not in iphone 5?
Thanks

from actionsheetpicker-3.0.

skywinder avatar skywinder commented on July 18, 2024

@lat233 in my case it reproduced on iphone 5,6 and iOS 7 and 8.
I think it related with performance of the devices. (in the video iphone 5 preform fetch a quite long time, but iphone 6 do it instantly).

from actionsheetpicker-3.0.

skywinder avatar skywinder commented on July 18, 2024

I don't see the easy way to resolve this case.
ActionPicker not adopted to show another one immediately.
As workaround I can recommend you just wait until first one is completely finish animation for 0.4 seconds. It looks smooth and clear.
just replace your string in example
[self second:sender];
to
[self performSelector:@selector(second:) withObject:sender afterDelay:0.4];

You can look at the example for this workaround in branch of this project 63-dismiss-picker

from actionsheetpicker-3.0.

lat233 avatar lat233 commented on July 18, 2024

Superb! It works like a charm after putting a delay of 0.4. You saved my life.
Thanks very much!

from actionsheetpicker-3.0.

skywinder avatar skywinder commented on July 18, 2024

@masterjox @lat233 Good news everyone! Since version 1.3.1 you don't have to wait 0.3 seconds! Just call next picker from done block!

from actionsheetpicker-3.0.

Related Issues (20)

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.