i think this is more to do with getting indegestion from swimming too soon after eating than anything else, so half an hour is probably about right to let your food go down.
Sophie is about right... I think the issue was that exercising too soon after eating could cause indigestion, stomach / muscle cramps etc, and this was perhaps more dangerous when swimming as opposed to say tennis due to the risk of drowning.
Bit of an old wives tale, I think, so long as you arent thinking of scarfing down a 3 course meal 15 mins before swimming :)
It would seem sensible to wait 30 mins or so after a snack, longer after a larger meal.
If you are just going in the water there is no reason to wait but if you are going swimming then half an hour is about right, I do a lot of very hard swimming training and I do not eat anything for at least an hour before swimming, if I do I soon have to stop because of feeling sick.