Thank you for your query.
Ear infections are common after a cold
Swimming can per se cause ear infections but it is not relevant in case of your child.
Try to take some precautions.At the onset of cold give him anti allergics and nasal drops.If he can gargle make him gargle with a medicated gargle.
Vaccinate him well against flu
. Check his sinuses
and adenoids.Check his blood allergy
level if this occurs again.
If you have any further queries you are free to consult me.
Hope this answers your query.
Wishing your child a speedy recovery.
Have a nice day.