Re: How to redraw a view in slow-motion
Re: How to redraw a view in slow-motion
- Subject: Re: How to redraw a view in slow-motion
- From: Matthias Arndt <email@hidden>
- Date: Sun, 19 Jun 2011 15:57:27 +0200
Hi Ken,
Am 19.06.2011 um 15:40 schrieb Ken Tozier:
> - (void)observeValueForKeyPath:(NSString *) inKeyPath
> ofObject:(id) inObject
> change:(NSDictionary *) inChange
> context:(void *) inContext
> {
> if ([inKeyPath isEqualToString: @"subsetRange"])
> {
> // figure out how many lines you still have to draw here
> if (stillHaveLinesToDraw == YES)
> {
> sleep(<some number of ticks>);
> [self setNeedsDisplay: YES];
> }
> }
> }
Thanks for this speedy reply! Using a KVO observer is a new approach I haven't considered, yet. But the main difference to my first idea is the usage of repetitive invocations of "drawRect:" instead a loop inside the method itself. To make this a slow-motion, you mentioned a "sleep(...)" (wasn't included in the mailing list reply), which will freeze the GUI, won't it?
CAAnimation sounds promising, unfortunately I haven't used it before, and animating several paths doesn't seem to be covered with basic animations ... I'd look deeper into the references, but currently I'm afraid it's beyond my capabilities.
Matthias_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden