I have a global variable p.
I have a function that draws (or redraws) my complex UIView objects depending on the value of this global variable.
When I increase p my uiview objects needs to be redrawed. I need this be done using animation.
double pInitialValue=0.5;
double pNewValue=1.0;
//somewhere before animation we must call [self redraw] to draw our view with p=pInitialValue;
//then, when we call animate function.
//we change p to pNewValue
//and every step must be redrawed using [self redraw]
p=pNewValue; //using animation p must slowly grow from pInitialValue to pNewValue
[self redraw]; //and ofcourse user must see every step of animation so we need to call redraw function
for example I need an animation with duration 4.
That means that during this 4 seconds my p must grow from pInitialValue to pNewValue and in every step my redraw function must be called
Help me, please. How can it be done?
You can use a timer to increase your
pvalue. Do that like this: have an instance variable in your class defined likeAfter that just before you want your animation to happen do:
Than have a method called
increasePlike this:Let me know if you have any question and if this works for you.