runway20 / PopoverView

A simple UIView popover control for iPhone/iPad written in CoreGraphics.
1.02k stars 214 forks source link

UITableView not responding to first tap #31

Closed jaiversin closed 11 years ago

jaiversin commented 11 years ago

Hi,

I'm having a problem when adding a UITableView to the popoverView. The TableView is showing properly, but the first tap on it is lost (the didDeselectRowAtIndexPath method is not being called).

After the first tap on the table, it works as is intended (the didDeselectRowAtIndexPath method is called normally).

This is the code I'm using:

self.myTable = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, 240, 120)];
self.myTable.delegate = self;
self.myTable.dataSource = self;

self.pv = [PopoverView showPopoverAtPoint:CGPointMake(40, 40)
                                   inView:self.view
                          withContentView:self.myTable
                                 delegate:self];

I tried adding the didDeselectRowAtIndexPath method on the example included and it presents the same behaviour.

I'm also using the component to show a custom calendar view and it works like a charm.

Spokane-Dude commented 11 years ago

I have the same problem, only I can't get a tap to transfer to a UIView… the UITableView is displayed correctly in the UIPopover.

On May 16, 2013, at 3:31 PM, Jhon Jaiver López notifications@github.com wrote:

Hi,

I'm having a problem when adding a UITableView to the popoverView. The TableView is showing properly, but the first tap on it is lost (the didDeselectRowAtIndexPath method is not being called).

After the first tap on the table, it works as is intended (the didDeselectRowAtIndexPath method is called normally).

This is the code I'm using:

self.myTable = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, 240, 120)]; self.myTable.delegate = self; self.myTable.dataSource = self;

self.pv = [PopoverView showPopoverAtPoint:CGPointMake(40, 40) inView:self.view withContentView:self.myTable delegate:self]; I tried adding the didDeselectRowAtIndexPath method on the example included and it presents the same behaviour.

I'm also using the component to show a custom calendar view and it works like a charm.

— Reply to this email directly or view it on GitHub.

ocrickard commented 11 years ago

I bet you found a tap gesture recognizer! I'll see if I can refactor this weekend.

jaiversin commented 11 years ago

I'm sorry... your component works perfectly (the autocomplete function of Xcode just trolled me)

I was using

didDeselectRowAtIndexPath:(NSIndexPath *)indexPath

instead of

didSelectRowAtIndexPath:(NSIndexPath *)indexPath

That's the why for the "strange" behaviour.

Again, forgive this enormous mistake!

ocrickard commented 11 years ago

Hey, no problem! I think my touch handling for this component wasn't great, so seemed totally plausible to me. One of these days I'll do a rewrite...

ocrickard commented 11 years ago

@Spokane-Dude Want to open an issue on this? Any ideas of what's causing it?

Spokane-Dude commented 11 years ago

Not right now… let me play with it for a bit… but thanks for offering… :D

On May 16, 2013, at 5:49 PM, Oliver Clark Rickard notifications@github.com wrote:

@Spokane-Dude Want to open an issue on this? Any ideas of what's causing it?

— Reply to this email directly or view it on GitHub.