marmelroy / PeekPop

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

Present real view controller in the preview #12

Open hansstefan opened 8 years ago

hansstefan commented 8 years ago

Instead of making a screenshot of a view controller at the begining and presenting a screenshot in the preview, you can present a viewController itself in the preview and make a screenshot of it at the commit. This screenshot is for smooth animation purpose only. The advantage is that if you have a content which is loaded from the server then it is loaded in the preview, just like in the original 3d Touch PeekPop. Below is the effect I was able to get. peekpop

marmelroy commented 8 years ago

Thanks @hansstefan.

I originally considered doing this but in my own tests I got very poor performance on iOS8 iPhone 4S.

I appreciate the pull request but will need to do some more testing before deciding on the next step...

hansstefan commented 8 years ago

I have just tested on iphone 4S with ios 8. Performance regarding showing the viewController is very good. The only problem is the delay caused by the blur calculations.

hansstefan commented 8 years ago

And by the way, have you thought about using UIPercentDrivenInteractiveTransition. It has a lot of similarity to what is needed.

mcgraw commented 8 years ago

Aw, so this is the issue I'm running into. Just got everything working for my 3D Touch device, and briefly touched on a non 3D touch device. Planned on diving into this more tomorrow.

+1 absolutely needed, even if we need to lay off of the crazy performance-heavy tasks. I'd say, at least, make things configurable and we can choose how to roll on our end. Not a massive deal as I'll just fork it myself. Just a thought/vote.

marmelroy commented 8 years ago

Thanks @mcgraw and @hansstefan. There's definitely a valid use case for using the full view controller but it should definitely be configurable (and in my opinion, not the default configuration). I'll work on an update.

michelalbers commented 8 years ago

Is there any progress on this? Would need that for previewing server generated data.

hansstefan commented 8 years ago

@michelalbers Check my pull request. The code is here: https://github.com/marmelroy/PeekPop/pull/13