A view controller that you present from your share app extension, allowing the user to compose social media posts.
SLComposeServiceViewController class provides a standard compose view, and you can present it for social sharing extensions on iOS and macOS. By default, the compose view includes items such as an editable text view and an indication of remaining characters, in addition to support for previewing attachments and displaying configuration items, such as an account or privacy picker.
The compose view controller gets items for the content and preview areas from the
extensionContext property of the extension’s
Configuring the Post Details
Managing the Contents of the Post
A string that represents the text which the user entered into the compose view’s text view.
A string that’s displayed in the compose view’s text view when the text view is empty.
The editable text view in the compose view.
Presenting the View Controller
Responding to Lifecycle Events
Canceling a Post
Starts the animated dismissal of the compose view.
A Boolean value that indicates whether the current content and attachments are valid.
Performs validation of the current content and updates the state of the Post button, if appropriate.
Loads a view that displays a preview of the attachments in the extension context.
Enabling Text Autocompletion
The view controller that manages an autocompletion view for suggesting common text completions while users type.