Code Monkey home page Code Monkey logo

Comments (5)

mpospese avatar mpospese commented on June 21, 2024

0 work as it already supports that! And yes, it's quite complicated (doing the pan as compared to a complete animation), and no, it's not perfect.

from mpflipviewcontroller.

ryanwaggoner avatar ryanwaggoner commented on June 21, 2024

Sorry for being dense, but am I missing something in the docs or code about how to enable this? I'm not seeing this working in the sample project, for example. If I do a pan on the page, nothing happens until some threshold is reached, and then the transition starts and completes, regardless of my finger position. I can't wiggle my finger back and forth in a one-inch area and have the page wiggle with it, for example.

from mpflipviewcontroller.

mpospese avatar mpospese commented on June 21, 2024

It's configured so that the pan is only recognized if you're close to the right or left edge of the view (I believe within 44 points). This is to prevent confusion / collision with the gesture recognizers used by the content view (remember, you can have pretty much anything in there).

Also start out going slow with your pan- if you go too fast, it will think you mean a swipe and just trigger the full animation.

You should be able to adjust both the margin amount (44 points) or the threshold velocity for triggering a swipe (at what point does it decide you meant a swipe instead of a pan) within the code to fine-tune it to your app's needs.

from mpflipviewcontroller.

mpospese avatar mpospese commented on June 21, 2024

There's also (unfortunately) some delay between when pan / swipe is detected and when the visual state actually changes - this is because both the old and new views have to be rendered as images to do the animation and this takes some time (4x longer under retina and especially noticeable on say iPad 3). There's a flag shouldRenderAllImages (or something like that) that you can set NO to only render the moving half of each view as an image and that should reduce any startup lag by approximately half, BUT that means the other (non-moving) half will be the actual live view (not static) and so depending on the content, may actually change while the animation is happening).

To eliminate the startup lag, the code could be modified to accept pre-rendered images of the page halves to be animated, so that it wouldn't have to render them when you trigger the pan / animation. But in order to do that, the content would have to be something static so that you could cache an image of it and not have it change.

from mpflipviewcontroller.

ryanwaggoner avatar ryanwaggoner commented on June 21, 2024

Oh awesome…got it now :)

On Jan 18, 2013, at 10:04 AM, Mark Pospesel wrote:

It's configured so that the pan is only recognized if you're close to the right or left edge of the view (I believe within 44 points). This is to prevent confusion / collision with the gesture recognizers used by the content view (remember, you can have pretty much anything in there).

Also start out going slow with your pan- if you go too fast, it will think you mean a swipe and just trigger the full animation.

You should be able to adjust both the margin amount (44 points) or the threshold velocity for triggering a swipe (at what point does it decide you meant a swipe instead of a pan) within the code to fine-tune it to your app's needs.


Reply to this email directly or view it on GitHub.

from mpflipviewcontroller.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.