I had a similar thing happen with my girl Reese. In the morning she was fine, in the afternoon, she had a white kind of scab looking thing on her eye. She didn't seem to be hurt by it but I took her to the vet anyway. It was just a piece of debris from the hay that they removed easily enough and fortunately there were no scratches or other issues. If it's something you can physically see on the surface of the eye it's probably not a cataract - they're smooth and very clearly under the eye's surface.
Either way your pig should see a vet right away because although it's not likely a cataract could have developed that quickly, if it is there's a serious medical condition causing it (like diabetes) and if it's not and it's something physically on the eye the pig might be in a lot of pain and need some medicine, or drops.