upload(mediaData_mimeType_progress_) - daneden/Twift GitHub Wiki

upload(mediaData:mimeType:progress:)

Uploads media data and returns an ID string that can be used to attach media to Tweets

public func upload(mediaData: Data, mimeType: String, progress: UnsafeMutablePointer<Progress>? = nil)

Parameters

  • mediaData: The media data to upload
  • mimeType: The type of media you're uploading
  • progress: An optional pointer to a Progress instance, used to track the progress of the upload task. The progress is based on the number of base64 chunks the data is split into; each chunk will be approximately 2mb in size.

Returns

A MediaUploadResponse object containing information about the uploaded media, including its mediaIdString, which is used to attach media to Tweets

⚠️ **GitHub.com Fallback** ⚠️