Just received the following e-mail suggesting changes to FlowCover.

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.

2 thoughts on “Just received the following e-mail suggesting changes to FlowCover.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s