Skip to content
This repository has been archived by the owner on Aug 14, 2019. It is now read-only.

Avatar imageView tap visual feedback #424

Closed
ghazel opened this issue Jul 29, 2014 · 6 comments
Closed

Avatar imageView tap visual feedback #424

ghazel opened this issue Jul 29, 2014 · 6 comments
Milestone

Comments

@ghazel
Copy link
Contributor

ghazel commented Jul 29, 2014

When tapping an avatar UIImageView, there is no visual feedback during the tap.

If the avatar was instead a UIButton, this would be handled automatically. In fact, casting a properly configured UIButton to UIImageView and returning it from avatarImageViewForItemAtIndexPath works pretty much as expected.

Three ways to implement this come to mind:

  1. let the user return a UIButton
    • changes the API
    • user has register an action and use indexPathForItemAtPoint to get the indexPath, which is a little pain
    • the long press recognizer for context menus must be configure to skip UIButtons
  2. UIButton inside JSQMessagesViewController
    • changes the api less
    • maybe requires a lot of copying of UIImageView properties from the user-supplied object to the readonly UIButton.imageView (ugg)
    • same longPress exception as option 1
  3. Manual mask on touchesBegan
    • need to get touchesBegan
    • find a way to emulate the UIButton mask to fit the user-supplied image view

So, how would you prefer this to work? Any other implementation ideas?

@jessesquires
Copy link
Owner

thanks @ghazel - This is on my list of things to do soon. I've also considered most of these options, but I'm not sure which I prefer yet...

@ghazel
Copy link
Contributor Author

ghazel commented Jul 29, 2014

For my app, I chose (option 1) to return a UIButton. Maybe the API should go even farther and just accept any UIView. This seems the most customizable from a user perspective, if somewhat less convenient.

@brbgyn
Copy link

brbgyn commented Aug 2, 2014

If it's a non specific task to be called, you can do this with just this:

imageView.userInteractionEnabled = YES;
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(avatarTap)];
[imageView addGestureRecognizer:tap];

and any touch on any avatar will call the selector you choose

@ghazel
Copy link
Contributor Author

ghazel commented Aug 2, 2014

There is already a tap gesture recognizer that JSQ provides. The issue is that there is no visual feedback of the tap (grey mask applied to the image while the user's finger is down)

@brbgyn
Copy link

brbgyn commented Aug 2, 2014

hmm right

@jessesquires jessesquires added this to the Release 6.0 milestone Aug 31, 2014
@jessesquires
Copy link
Owner

Fixed by completing #319 and set for 6.0 release. See branch release-6.0.

See release 6.0 milestone details here

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

No branches or pull requests

3 participants