WEPopover icon indicating copy to clipboard operation
WEPopover copied to clipboard

Present WEPopover from UITableViewCell subclass

Open AnthoPakPak opened this issue 8 years ago • 0 comments

Hi,

First, thanks a lot for your great work.

Here is what I'm trying to achieve : I have a UITableView with custom cells subclassed. Cells are composed of some buttons that should present WEPopover on touch. The touch action is implemented in the cell's subclass. I would like to allow Up and Down arrow directions as in the Demo project.

I succeeded in presenting the popover but arrow directions seemed to be ignored. Indeed, whatever the space available, it's always the same direction.

Here is the code used in cell's subclass :

[self.likeCommentPopoverController presentPopoverFromRect:self.commentNumberButton.frame inView:self permittedArrowDirections:(UIPopoverArrowDirectionUp | UIPopoverArrowDirectionDown) animated:YES];

I tried to present it from tableView but it doesn't work :

CGRect rect = [self.superview.superview convertRect:self.commentNumberButton.frame fromView:self]; [self.likeCommentPopoverController presentPopoverFromRect:rect inView:self.superview.superview permittedArrowDirections:(UIPopoverArrowDirectionUp | UIPopoverArrowDirectionDown) animated:YES];

Have you got an idea to achieve this ?

Thanks a lot.

Anthonin

AnthoPakPak avatar May 02 '16 15:05 AnthoPakPak