You have to complete a year-long internship at an ACGME approved program. Most people do a transitional year program,
here's the list. You can do your PGY-1 year in internal medicine, surgery or even pediatrics. From the AAO:
Residency Match - American Academy of Ophthalmology
All you have to do is match into a PGY-1 year through presumably ERAS/NRMP, complete that and then apply through the ophthalmology match. I don't know
why it works that way, but that's how it works.