Specifically we are talking about eating after waking up and before swimming, also distance swimming. Keeping digestion time in mind.
The body stores glycogen in the liver and blood/muscles. About 20% in the liver, which is lower in the morning. However the remaining 80% obviously provides more energy and is about 2000 calories, sufficient for 2 hours of high intensity exercise and is unaffected by sleep. It is however more important to eat after swimming, a mix of protein for muscle repair and some cabs to metabolize it.
I regularly don't eat at all before morning swimming and have no problems. Some of it is just experience and confidence and getting used to how my body works, and not worrying about people telling me I had to eat.
Whether you need to eat before swimming is more about personal preference than anything else. I do intermittent fasting, and almost never eat anything before I swim, or run, or bike, or lift weights, and thousands of other people do the same.
That being said, I've read from plenty of people who have to eat before they work out, so my advice is to do what works for you.
However if I am planning a longer 2 hr plus swim, then I make sure to eat.
Top of my list, like a lot of swimmers, is porridge. I hate porridge though I've gotten used to eating it. I avoid processed food when heavy training and don't believe in advocating its use as it sets bad habits.
A better solution is a home-made smoothie. I use low-fat natural or Greek yoghurt, frozen or fresh berries, half a cup of oats, and apple or orange juice. Easy to make, quick, delicious and easy to eat, 1 minute getting stuff from fridge, 20 seconds in a blender and both tasty and high in protein and carbs.
You can enhance it by the occasional addition of iron-rich water, if you do this make sure there are no grapes or grape juice which blocks metabolisation of iron.
I eat both before all longer swims, though I don't swim marathons, and while I love coffee, I mostly only drink de-caff most so that I can maximize the ergogenic effects of caffeine during a swim.