When you first enter a battle, the gym pokemon is going to use 2 attacks back to back, so dodge those when you start. Then, depending on your pokemon's attack speed, you can figure out how many times you can "tap" before swiping to dodge (ie. If I'm using a vaporeon against a flareon and flareon...