Get Updates By E-mail 

Article Written By:
Johann Dowa

Open Source Tween Library W/Concise UIView Animation Syntax And Ability To Tween Any Numeric Value

  •  
  •  
  •  
  •  
  •  

Some time ago I mentioned a library allowing you to drastically shorten the syntax needed for UIView animation providing a clean blocks based animation syntax.

Today I came across a library known as PRTween that takes things another step further by providing a tween library for UIView animation (or any other numerical value).  You can tween properties UIView properties that you normally could not,  and the library provides a very elegant syntax with blocks based callbacks.

Here’s an example of a simple alpha tween with PRTween:

PRTweenPeriod *period = [PRTweenPeriod periodWithStartValue:100 endValue:200 duration:3];

Which is identical to this code without PRTween:

someView.alpha = 1;
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:3];
someView.alpha = 0;
[UIView commitAnimations];

You can find the library from Dominik Hoffman with a complete example on Github here and the repository for an ARC compatible fork can be found on Github here.

A great looking library for easy UIView animations – or any numeric variable tweening.


  •  
  •  
  •  
  •  
  •  

Submit A Resource

Have you created a useful tutorial, library or tool for iOS development that you would like to get in front of our 300,000+ monthly page views from iOS developers?

You can submit the url here.

The resources we feel will appeal to our readers the most will be posted on the front page.

Comments