Yes thats right! it is important to eat something light before swimming, even if is a morning practice. It will give you more energy and you will be able to swim better, I recommend eating something around 30 to 60 minutes before, but it varies on every person so you can try different times to see what works better for you.
Healthy things you can eat before are fruits, apples, banana, strawberries, a spoon of peanut butter, a slice of bread, nuts, healthy snack bars, energy bars etc. I recommend that you alternate these types of snacks and not have the same every day.
For after workouts its always good to have a complete meal (protein, vegetables, carbs etc)
There is a great instagram account with excellent ideas for snacks before and after workouts. its call berryhealthyday
Remember that having a healthy diet is very important specially when doing a sport!