Code Monkey home page Code Monkey logo

Comments (13)

mpospese avatar mpospese commented on July 4, 2024

Unfortunately a known issue with retina screens - 4x more pixels to be rendered and because it's from UIKit, the rendering has to be done on the main thread and is CPU-bound. If you set the shouldRenderAllViews flag to NO, that should cut the start up time roughly in half. The downside will be that the non-moving half of the page will be live (i.e. if you're content is moving/changing) then it will change during the animation.

If your content is static - i.e. you could render it as images ahead of time because it doesn't change, then you could mod the library to pass in the images to use (the "halves" of the pages) and then flip should start instantaneously.

from mpflipviewcontroller.

elsurudo avatar elsurudo commented on July 4, 2024

Hi Mark,

First of all, this looks like a great library, and I'm looking forward to using it in an upcoming project.

I'll probably need to do some speed optimizations myself, similar to the author here. I was wondering if you could clear up a few things for me.

I'm not a Quartz expert by any means, but I was under the impression that a CALayer renders the view into a raster image for OpenGL to use while performing animations. If this is true, why is it necessary to manually render the page views to pass to the library? Couldn't you just manipulate the CALayer, and it should "just work"? I'm probably missing something here, but seeing as how I'll likely need to make some changes to the library, I'm interested in the design decisions.

As for rendering static content ahead of time to have an instantaneous flip start, is it possible to do that in a thread-safe manner? If so, how? Perhaps make an exact replica view off-screen, and render that one?

Looking at your code really makes me appreciate the effort Flipboard team went through! Their flips are near-instantaneous, and they can even have dynamic elements changing during the flip! Quite amazing.

from mpflipviewcontroller.

hankbao avatar hankbao commented on July 4, 2024

Hi, @mpospese. AFAIK, in iOS 4 and later the rendering can be done off the main thread. I'm not sure if this could help to achieve the instantaneous flipping effect. It may still be a performance gain anyway.

Hey, @elsurudo. Have you made some effects close to the Flipboard one yet? Their flipping is really smooth even on the retina iPad. I wonder how they achieve it.

from mpflipviewcontroller.

elsurudo avatar elsurudo commented on July 4, 2024

@hankbao Unfortunately not. I ended up going with a UIPageViewController in the end with a page curl transition, as that is what the client preferred anyways.

The Flipboard transitions are definitely impressive, though. Their images usually aren't Retina (if I remember correctly), and they layouts are rather simple, which would definitely help with the initial rendering speed.

from mpflipviewcontroller.

mRs- avatar mRs- commented on July 4, 2024

i created a method to take screenshot after each flip animation from the viewcontroller before and after. This is really a speed up for the responsiveness

from mpflipviewcontroller.

hankbao avatar hankbao commented on July 4, 2024

@mRs- That's cool. Do you take screenshot off the main thread? If that's the case, sync main thread painting with background screenshot when performing serial fast flipping may be a problem.

from mpflipviewcontroller.

mRs- avatar mRs- commented on July 4, 2024

I added a Flag if the screenshots are done by the background process. Then i implemented a real hard hack in the MPFlipViewController to make a flip wit a pre-rendered image. If the flag is false i use the normal method to flip to the ViewController to guarantee the best user experience.

from mpflipviewcontroller.

kev52 avatar kev52 commented on July 4, 2024

@mRs- can you share your modifications with us?

from mpflipviewcontroller.

mRs- avatar mRs- commented on July 4, 2024

Not at the moment but in near future it will be a good idea, i put it in my list.

from mpflipviewcontroller.

mRs- avatar mRs- commented on July 4, 2024

If you want a really smooth animation it not possible with the current state of the library. I tried to fix this but if we take screenshots there will be downsides of performance because the most common problem about this lib is, that you want to create a screenshot of a ViewController that is not existing. We have to first create the ViewController with its content and take then a screenshot. Building the ViewController and taking the screenshot together is really slow.

A better way is to create the flip effect at first time without a delay for the user and update the FlipView Layer on the bottom or top side on a background process and send it back to the main process. This will speed up the animation for the user.

The next problem is, that this is really slow to do that on the CPU so a transfer to the GPU would speed this up too. And another problem is to take screenshots for this. a normal Transform would be a real better option to boost performance on this, but i have no idea if this is easy to create or where i should start with this.

If anyone have a idea how to create a fold animation without taking a screenshot that would be really cool. I would like to implement this to create a Flipboard like user flow.

I transfered this library to UIScrollViews instead of scrolling you can flip the pages but there is the downside of creating the screenshots at all :(

from mpflipviewcontroller.

NikunjGodhani avatar NikunjGodhani commented on July 4, 2024

I have use this flipping in my project. . . and also i set shouldRenderAllViews flag to NO then also it takes time when flipping performs. How to decrease the Flipping delay. I want to increase the speed of the flip animation. Please give me solution of that problem reply as soon as possible.

Thank You in Advance

from mpflipviewcontroller.

mRs- avatar mRs- commented on July 4, 2024

The only Solution is to reduce the quality of the screenshots that are made. iPhone 4 is really slow and it's not supported by Apple any more.

Von meinem iPhone gesendet

Am 16.09.2015 um 06:05 schrieb NikunjGodhani [email protected]:

I have use the flipping in my project. . .How to decrease the Flipping delay. I want to increase the speed of the flip animation. Please give me solution of that problem replay as soon as possible.

Thank You.


Reply to this email directly or view it on GitHub.

from mpflipviewcontroller.

NikunjGodhani avatar NikunjGodhani commented on July 4, 2024

@mrs, How would i know quality of the screenshot because i used this in my project, in that xml parsing implement. so how i create the screenshot for upcoming news.

And please can you give me where is the path of that screenshot on that library.

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.