microdotblog / sunlit

Publish photos to your own blog — hosted by Micro.blog or compatible blogs using WordPress or Micropub — and discover beautiful photos from other users.
https://sunlit.io
MIT License
50 stars 7 forks source link

Fix to set alt text on the media item #142

Closed cfristrom closed 1 year ago

cfristrom commented 1 year ago

Add a media item reference to AltTextController and set it before showing the view. Use that item's alt text to initialize the text view and make it first responder when the controller's view is shown. Update the media item's alt text when the user selects the "Add" button. Also remove unused outlets and commented out code.

Tested by starting a new post, adding an image, and selecting the "Add Description" option for that image. Confirmed that the text is stored in the media item by entering some text, selecting "Add", and then re-selecting the "Add Description" option to see the same text. Confirmed that selecting "Cancel" leaves the text unchanged. Completed the post and confirmed that the text appears in the alt tag for the image.

manton commented 1 year ago

Thank you!