Timer not invalidating Dirty girls online now chat

29-May-2016 00:27

In our project we have a Facebook style wall with posts and status updates.As this is a very interactive part of an app it should be refreshed quite often.

As you can see, passing such a simple information through half of the VIPER structure may be one of the reasons to start looking for an alternative.

However, for a repeating timer, you must invalidate the timer object yourself by calling its invalidate method.

Calling this method requests the removal of the timer from the current run loop; as a result, you should always call the invalidate method from the same thread on which the timer was installed.

In fact it gets called every time you switch views or after you dismiss a modal view.

Basically any time your view actually reappears on screen, not just the first time.

As you can see, passing such a simple information through half of the VIPER structure may be one of the reasons to start looking for an alternative.However, for a repeating timer, you must invalidate the timer object yourself by calling its invalidate method.Calling this method requests the removal of the timer from the current run loop; as a result, you should always call the invalidate method from the same thread on which the timer was installed.In fact it gets called every time you switch views or after you dismiss a modal view.Basically any time your view actually reappears on screen, not just the first time.Invalidating the timer immediately disables it so that it no longer affects the run loop.