Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tickbox enhancement #40

Closed
rando128 opened this issue Jan 3, 2015 · 4 comments
Closed

Tickbox enhancement #40

rando128 opened this issue Jan 3, 2015 · 4 comments

Comments

@rando128
Copy link

rando128 commented Jan 3, 2015

It would be useful to have to ability to add a tickbox to the alertview allowing the user to select "don't show this again". Ideally with blocks:

//Using Blocks With Validation
[alert addTickbox:@"Don't show again" validationBlock:^BOOL {
BOOL tickboxValue = ....
return tickboxValue;

} actionBlock:^{
// handle successful validation here
}];

@gmogames
Copy link

gmogames commented Feb 8, 2015

+1

1 similar comment
@MarshalGeazipp
Copy link

+1

@dogo
Copy link
Owner

dogo commented Jan 27, 2016

Please test the develop branch

    SCLAlertView *alert = [[SCLAlertView alloc] init];

    SCLSwitchView *switchView = [alert addSwitchViewWithLabel:@"Don't show again".uppercaseString];
    switchView.tintColor = [UIColor brownColor];

    [alert addButton:@"Done" actionBlock:^(void) {
        NSLog(@"Show again? %@", switchView.isSelected ? @"-No": @"-Yes");
    }];

    [alert showCustom:self image:[UIImage imageNamed:@"switch"] color:[UIColor brownColor] title:kInfoTitle subTitle:kSubtitle closeButtonTitle:nil duration:0.0f];

@dogo dogo closed this as completed Feb 2, 2016
@rando128
Copy link
Author

Works great. Thx. From a UXD standpoint though, it might be better to place the switchView below the buttons.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants