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

Custom Button Cell #492

Closed
losedges opened this issue Aug 6, 2015 · 5 comments
Closed

Custom Button Cell #492

losedges opened this issue Aug 6, 2015 · 5 comments

Comments

@losedges
Copy link

losedges commented Aug 6, 2015

ask for advice, how to make 2 buttons in a row, each button calls its modal window? Receive data from from Custom Row based BaseCell works fine. how to make a call Custom Button Cell

I would be grateful for the help

@jettandres
Copy link

+1 for this. I've been struggling the same issue!

@jiangxin1980
Copy link

+1, thanks

@rockzzvn
Copy link

+1

@saqib-saud
Copy link

saqib-saud commented Dec 1, 2016

Its simple and straight forward to perform action in case of 1 button. In case of 2 buttons, should we use 'leftRightSelectorLeftOptionSelected' ?

We can use 'leftRightSelectorLeftOptionSelected' to set another 'XLFormAction' and then use it to perform action. But it seems to be hacky, what is the suggested way?

-(void)rightButtonPressed:(UIButton *)rightButton
{
    NSLog(@"DiD select Right");
    XLFormAction *rightAction = (XLFormAction *)self.rowDescriptor.leftRightSelectorLeftOptionSelected;
    

        UIViewController * controllerToPresent = [self controllerToPresent];
        if (controllerToPresent){
            if (self.formViewController.navigationController == nil || [controllerToPresent isKindOfClass:[UINavigationController class]] || rightAction.viewControllerPresentationMode == XLFormPresentationModePresent){
                [self.formViewController presentViewController:controllerToPresent animated:YES completion:nil];
            }
            else{
                [self.formViewController.navigationController pushViewController:controllerToPresent animated:YES];
            }
        }
        
    
    
}

@mats-claassen
Copy link
Member

@wisesabre has an example of this in #917

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

6 participants