Air doesn’t float, it just doesn’t sink as hard
to fly and to swim are very different actions
1 a : to propel oneself in water by natural means (such as movements of the limbs, fins, or tail) b : to play in the water (as at a beach or swimming pool) 2 : to move with a motion like that of swimming : glide a cloud swam slowly across the moon 3 a : to float on a liquid : not sink b : to surmount difficulties : not go under sink or swim, live or die, survive or perish— Daniel Webster 4 : to become immersed in or flooded with or as if with a liquid potatoes swimming in gravy 5 : to have a floating or reeling appearance or sensation
https://www.merriam-webster.com/dictionary/swim
Apparently, swimming inherently requires a liquid.
Some birds fly through the water.
The common merganser, for instance.
Air is a mixture of gases also qualifying as a fluid, so I see the logic here.
A more interesting question would be in the absence of gravity, would you sink in a liquid or remain on the surface? (Surface tension/buoyancy issue)