addAltText(to_text_) - daneden/Twift GitHub Wiki

addAltText(to:text:)

Allows the user to provide alt text for the mediaId. This feature is currently only supported for images and GIFs.

@available(*, deprecated, message: "Media methods currently depend on OAuth 1.0a authentication, which will be deprecated in a future version of Twift. These media methods may be removed or replaced in the future.")
  public func addAltText(to mediaId: Media.ID, text: String)

Usage:

  1. Upload media using the upload(mediaData) method
  2. Add alt text to the mediaId returned from step 1 via this method
  3. Create a Tweet with the mediaId

Parameters

  • mediaId: The target media to attach alt text to
  • text: The alt text to attach to the mediaId