After the sunburn, you will get the swollen eyes with no protection for the eyes. Usually you need to wear the sunglasses to protect the eyes from the strong sun light and make your eyes not get damaged. If you don't wear it, you will easily get the swollen eyes. You could use the warm compress to make your eyes feel comfortable.
According to what you told, perhaps I could assume that your eyes are allergic to sunshine due to some particular reasons, which gave rise to your swollen eyes, because that is one of the symptoms from allergic reactions. For the moment, you just need to get some anti-allergic medicines from the hospital and take good care of your eyes. Also, try to build up your physique and immune system by taking more and more exercises.