iphone - in ios dev, how to handle case based animations? -


my questions best asked stating problem:

in app, there 2 button choices, lets 1 & 2. when click , hold on 1, 2 fades out (alpha change) on .3 seconds, , vice versa.

if user 'cancel's' button touch (by dragging finger away button , releasing) opposite button fades in.

this works great. problem arises when user not hold down on button, , clicks touch registered in under .3 seconds (the time takes other button fade out) thing there more animations have happen after guess issue animations further down line interrupt .3 sec fade , things start awkward.

suggestions work this? thank you!

as suggested in this post, should create secondary uiview animation goes same animation endpoint 0.3 second one. make sure set animation begin current state, , give short time let you. views @ end of first animation, , happen more quickly. after animation done, other animations based on button results.

[uiview beginanimations:nil context:null]; [uiview setanimationbeginsfromcurrentstate:yes]; [uiview setanimationduration:0.03]; [uiview setanimationcurve: uiviewanimationcurvelinear]; // here set view , animation stuff other animation takes 0.3 seconds  [uiview commitanimations]; 

this state in after 0.3 second animation , can begin animation there.


Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -