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 Accessory View Not Clickable #715

Open
fvonhoven opened this issue Jul 7, 2015 · 4 comments
Open

Custom Accessory View Not Clickable #715

fvonhoven opened this issue Jul 7, 2015 · 4 comments

Comments

@fvonhoven
Copy link

Here's an example of the problem: https://github.com/fvonhoven/pm_bug_accessory_view

I'm unable to capture my click on the UIImageView, seems like a bug.

@squidpunch
Copy link
Contributor

did you set the userInteractionEnabled to true? From what I recall I think a UIImageView is false by default, so clicks wouldn't be recognized.

@squidpunch
Copy link
Contributor

looks like you did enable them though, and i see its about an accessory view (sorry I read too quickly the first time)

If nobody else gets to digging into this, I will try and check it out sometime in the next couple of days or so.

@kevinvangelder
Copy link
Contributor

@fvonhoven Thanks for reporting the issue, and sorry it's taken so long for us to get back to you.

I did some investigating on this issue this morning and you are correct that this does not work as documented. According to Apple's documentation, the only method that I can find that would allow us to hook in and connect your method to an event only applies to Disclosure Button accessory views. https://developer.apple.com/library/ios/documentation/UIKit/Reference/UITableViewDelegate_Protocol/index.html#//apple_ref/occ/intfm/UITableViewDelegate/tableView:accessoryButtonTappedForRowWithIndexPath:

And this StackOverflow answer confirms: http://stackoverflow.com/a/869643/811307

I'll keep trying to think of a way that we can implement this on our side, but I'm no Obj-C master (yet), so your best bet may be to implement your action on your UIImageView (possibly by wrapping it in a UIButton) for now.

@jamonholmgren Any input on this?

@squidpunch
Copy link
Contributor

@fvonhoven I also apologize, i said "if nobody gets to this il check in a few days"....29 days ago
you could probably capture a click using an rmq event on the UIImageView as well (maybe) but if you want it to hit the delegate, sounds like based on what @kevinvangelder said it's not going to work unless its a button...

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

No branches or pull requests

3 participants