iOS PDF DropDown Select view controller

13 views
Skip to first unread message

Luben Ivanchev

unread,
May 10, 2017, 12:17:43 PM5/10/17
to PDFTron PDFNet SDK
Good day,

I am trying to select a drop down item from a form field in a PDF. 
I notice the choiceFormViewController is invoked to display the items in a TableView on iOS.
However choiceFormViewController has no didSelectRowAtIndexPath method declared.
After declaring it I noticed the method was never called.
Some research revealed I cannot have a UITapGestureRecognizer on top of a TableView because it cancels the table actions.
Seemingly a common problem, most suggestions were to set [gestureRecognizer setCancelsTouchesInView:NO]; 
However, this had no effect either when declared immediately after gesture initialization, before and after view controller initialization or display. Leading me to believe this might not be the problem.   

This is the code I added to ChoiceFormViewController.m:

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {

    UITableViewCell *selectedCell = [tableView cellForRowAtIndexPath:indexPath];   

    NSLog(@"selected index : %@", indexPath);

    NSLog(@"selected text  : %@", selectedCell.textLabel.text);

}


Any suggestions?

Best Regards,
Luben

Ryan

unread,
May 25, 2017, 7:19:09 PM5/25/17
to PDFTron PDFNet SDK
However choiceFormViewController has no didSelectRowAtIndexPath method declared.

That is correct, didSelectRowAtIndexPath is called on the ChoiceFormViewController's delegate, which in the tools project is the FormFillTool.

After declaring it I noticed the method was never called.

The method will be called on whichever object is set as the ChoiceFormViewController's delegate. If you wish to use ChoiceFormViewController without the FormFillTool, you can set its delegate to something else, including the ChoiceFormViewController itself.

We hope this helps. Please let us know if you have any other questions.
Reply all
Reply to author
Forward
0 new messages