ios - NSTimer blocks other animations -


description

i have nstimer updates uilabel every second. have uiimageview slides in screen when uibutton pressed.

issue

the problem when nstimer updates uilabel, animation of uimageview stops completing.

question

please can tell me how can update timer without messing other animations?

this common symptom of having auto layout turned on trying slide across screen adjusting frame or center. auto layout ios 6+ feature controls location , size of various uiview elements. unfortunately, when have auto layout on, every time change label's value, reapply constraints dictate label should positioned, defeating attempts animate it.

two solutions:

  1. turn off auto layout opening storyboard or nib, click on first "document inspector" tab on rightmost panel, , uncheck "use autolayout".

    show autolayout

  2. if want use autolayout, animate moving of control changing constraints rather changing frame or center. see here example of how can create iboutlet constraint , change constraint programmatically in animatewithduration block.

references:


Comments

Popular posts from this blog

c++ - Function signature as a function template parameter -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -

How to call a javascript function after the page loads with a chrome extension? -