marmelroy / PeekPop

Peek and Pop with backwards-compatibility
MIT License
1.95k stars 123 forks source link

Add an UIPreviewAction while peeking. #6

Open Dershowitz011 opened 8 years ago

Dershowitz011 commented 8 years ago

I know this cannot be implemented without the 3D touch API but could you add a gesture recognizer for when the peek method is run, and while the user still has is finger on the view and he swipes up, the action menu comes from below. Could you do that? Is that possible?

marmelroy commented 8 years ago

Hi @Dershowitz011, it's definitely something I would like to implement.

There are a couple of issues due to the way Apple's previewing API reads the UIPreviewActions (basically, creating a backwards compatible version that supports iOS8 will require some swizzling). Displaying them is a bit complicated too (will need to support nested groups of actions).

I have a local branch where I'm working on this but it's still very experimental and won't be ready for a while...

Dershowitz011 commented 8 years ago

I've been trying to figure out how Instagram does it too. It's flawless the way it has implemented preview actions on older iPhones. If you could get to know how Instagram did it, maybe you'd have a breakthrough getting them done with this project.

marmelroy commented 8 years ago

Thank for the suggestion .

I'm guessing Instagram's implementation is very specific to their needs (also, no nested action groups, no transition animation between states and no 'pop' on older devices).

The real challenge is making something general and elegant that developers can use in any codebase .

Dershowitz011 commented 8 years ago

I'll keep looking too! Will comment in case I hit something PRECIOUS. 😎😎

Dershowitz011 commented 8 years ago

Hi @marmelroy Could you please tell me how to work on the peek which is shown when we press and hold an image for a while? For instance, I'd like to add a swipe gesture to that particular view which comes when we peek. How do I do that?

marmelroy commented 8 years ago

Well... you kind of need to write your own custom behaviour inside the PeekPopGestureRecognizer...

Again, as I mentioned, I am working on a clean implementation of this and it will be ready within the next few weeks.

TheDarkCode commented 8 years ago

Any updates on this @marmelroy? If not, I'm considering putting together a pull request.

jcampbell05 commented 8 years ago

Any progress on either of these ?

umarFarooque commented 8 years ago

Any updates ?

puelocesar commented 7 years ago

Maybe take a look at his implementation: https://github.com/kevin0571/STPopupPreview

Their preview actions work well, but their longpress trigger is awful