domhofmann / PRTween

Lightweight tween library for iOS
BSD 2-Clause "Simplified" License
459 stars 63 forks source link

Add Core Animation / UIView fallbacks #7

Open domhofmann opened 13 years ago

domhofmann commented 13 years ago

This is starting to look like a pretty good drop-in replacement for all animations with the introduction of shorthands. I think it would be valuable to add a way to fall back to Core Animation or UIView animation, while still using the syntax here.

domhofmann commented 13 years ago

Basic support for this has been committed. There is still some more work to be done, but in general using the shorthand syntax for something that can be animated with Core Animation or UIView will fall back to one of those models.

For example: [PRTween tween:someView property:@"alpha" from:1 to:0 duration:2] would use a UIView animation. I'm working on adding support to allow someone to turn this off on a case-by-case basis, but for now it can be turned off through the useBuiltInAnimationsWhenPossible property on PRTween (or [PRTween sharedInstance])

domhofmann commented 13 years ago

Additionally, fallbacks can be overridden on a case-by-case basis like this:

[PRTween tween:someView property:@"alpha" from:1 to:0 duration:2].override = YES;
domhofmann commented 12 years ago

There's some remaining work on this ticket before we have full coverage on all built in animations, but the existing code base covers most basic cases now.