-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The library works slow on iPhone 4 #4
Comments
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. |
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. |
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. |
@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. |
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 |
@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. |
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. |
@mRs- can you share your modifications with us? |
Not at the moment but in near future it will be a good idea, i put it in my list. |
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 :( |
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 |
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
|
@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. |
Hello,
The library is great but there is one problem. When I test it on iPhone 4 flip is very slow. I took 1 second to start the flip.
The text was updated successfully, but these errors were encountered: