I don’t really have the time to respond or expand on this e-mail, and I don’t know if the code that Ilkka Pirttimaa provided is correct. But I wanted to post this here so other people playing with FlowCover can play with the code.
Here are his suggested changes:
Hello!
I like your Flow Cover implementation a lot, thank you!
I needed to get event when animation is stopped. This is my suggestion to code:
FlowCoverView.h:
@protocol FlowCoverViewDelegate - (int)flowCoverNumberImages:(FlowCoverView *)view; - (UIImage *)flowCover:(FlowCoverView *)view cover:(int)cover; - (void)flowCover:(FlowCoverView *)view didSelect:(int)cover; - (void)flowCover:(FlowCoverView *)view animationStoppedAt:(int)cover; //ADDED @end
FlowCoverView.m:
- (void)driveAnimation { double elapsed = CACurrentMediaTime() - startTime; if (elapsed >= runDelta) { [self endAnimation]; /* * Change from Ilkka Pirttimaa <ilkka.pirttimaa@gmail.com>: * You can listen this callback if you need to change UI when animation * is stopped. */ if (delegate) [delegate flowCover:self animationStoppedAt:(int)floor(offset + 0.01)]; // make sure .99 is 1 } else { [self updateAnimationAtTime:elapsed]; } }
The code appears to be a useful addition to the existing code base. Someday, when I have some spare time (*cough*), I’ll update the code base with this and other suggestions.
Awesome! Really useful for me, thanks!
LikeLike
Hi William, Ijust made a quick mod to Flow Cover to support retina displays, I’m not sure if it’s the best fix but it seems to work.
You can see it at http://www.markmc.co.uk/2011/02/23/flow-cover-fix-for-retina-display/
Thanks for providing such an excellent tool.
LikeLike