I have a rather simple question with regards to UIView animations but it has taken me the whole day trying to solve.
I want to implement a UIView animation that will be triggered by an event inside code. Meaning it is not triggered by the user pressing a button, nor by the view loading, it will be triggered by something that happens inside the gameplay (an explosion effect for an image)
The tutorials and videos i have seen so far all declare their UIView animations inside the viewDidLoad, that wouldn't work for me as I don't want the animation happening immediately.
Some write it inside "touches" triggered by the user fingers. That wouldn't work either as the human touch does not initiate the animation.
My game utilizes a timer and "gameLoop" so when I write the animation code inside the main method it gets called 100+ times in 1 second (I see in the console the log for the animation repeating again and again).
I think this is because the main method is attached to the main timer which refreshes it every 1 second.
Where should i type the code for a UIView animation if I want it to be called just ONCE instead of infinitely?
Should I form a new method for the animation? How would I call that method if ever?
Thanks to all who can help.