Swimming pools are a perfect storm for attracting flies. Almost everything that a fly is attracted to is provided by or near a pool. All that's missing is a large garbage pile next to it, and it would be fly heaven. Unfortunately, there is little you can do to make your swimming pool less attractive to flies. Pyrethrin aerosols or mists can sometimes reduce fly activity but only provide short term relief. Your best bet is to keep a fly swatter within reach to quickly get rid of any flies that become annoying.

...
Almost everything about swimming pools attract flies.

Water

Flies are attracted to moisture. But it may not be the water in your pool that is attractive to the flies. As water is splashed around, the shrubbery, grass and vegetation around the pool gets moist. If not kept trimmed and free of debris, it can become a breeding ground for a number of flies and other flying insects. Many species of flies also lay their eggs in water and may check out your pool as a possible place to lay their eggs.

Shiny Reflective Surfaces

Flies are attracted to shiny surfaces. On a sunny day, your pool is one giant reflective surface that serves as a beacon to a number of flies. Flies are also attracted to dark objects. People wearing white or brightly colored clothing are less attractive to flies than those wearing dark-colored clothing. Flies are more attracted to people floating or swimming in the pool because the light surface of the pool serves as a contrast for them.

People

People provide three things that attract flies. Flies like warmth, and people sitting in the sun or playing in the pool provide ample quantities. Warmth and exertion also cause people to breathe out more carbon dioxide, another fly attractant. Their love of carbon dioxide is why flies tend to hover around faces. The final attraction for flies is motion, again something people tend to do a lot around a swimming pool.

Lights

Lights located around swimming pools can also attract flies, especially if your pool is located near other water sources like lakes or streams. Aquatic insects flying around at night will be attracted by the water and lights around your pool. Mercury vapor lights are especially attractive because they provide ultraviolet energy, according to William F. Lyon, an entomologist with Ohio State University. The less light you use around your pool, the fewer bug problems you'll have. Installing lights 20 to 30 feet away from the pool will help keep flies away. Also use yellow light instead of white light whenever possible.