문제

I have two lines of code that are executed just before the pop of a view. Those two lines are making some scrolling. Because of those 3 animations, there are many things that the user don't see, or let's say don't see well.

I don't want to use callbacks to deal with this. I just need the app to wait some 0,5 secs for the view to pop, and 0,5 secs more beetween the two scroll calls to let him see what is happening.

How may I do this easily without stopping the animations ?

I tried (quickly) [NSThread sleepForTimeInterval:0.5]; but it stops everything. Of course.

도움이 되었습니까?

해결책

You can't wait for an animation to finish from the main UI thread without exiting from the current method after the first line and using a callback for the second line.

If you don't like callbacks, your alternative is to queue your two lines for execution in a background thread.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top