<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.10.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Social",
  "identifier" : "/documentation/Social/SLComposeServiceViewController",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Social"
    ],
    "preciseIdentifier" : "c:objc(cs)SLComposeServiceViewController"
  },
  "title" : "SLComposeServiceViewController"
}
-->

# SLComposeServiceViewController

A view controller that you present from your share app extension, allowing the user to compose social media posts.

```
class SLComposeServiceViewController
```

## Overview

The [`SLComposeServiceViewController`](/documentation/Social/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 <doc://com.apple.documentation/documentation/UIKit/UIViewController/extensionContext> property of the extension’s <doc://com.apple.documentation/documentation/Foundation/NSExtensionContext> object.

## Topics

### Configuring the Post Details

[`configurationItems()`](/documentation/Social/SLComposeServiceViewController/configurationItems())

Returns configuration items to display in the compose view.

[`SLComposeSheetConfigurationItem`](/documentation/Social/SLComposeSheetConfigurationItem)

An object that provides additional configuration details to use when configuring a composition interface.

[`reloadConfigurationItems()`](/documentation/Social/SLComposeServiceViewController/reloadConfigurationItems())

Reloads the list of configuration items.

### Managing the Contents of the Post

[`contentText`](/documentation/Social/SLComposeServiceViewController/contentText)

A string that represents the text which the user entered into the compose view’s text view.

[`placeholder`](/documentation/Social/SLComposeServiceViewController/placeholder)

A string that’s displayed in the compose view’s text view when the text view is empty.

[`textView`](/documentation/Social/SLComposeServiceViewController/textView)

The editable text view in the compose view.

### Presenting the View Controller

[`pushConfigurationViewController(_:)`](/documentation/Social/SLComposeServiceViewController/pushConfigurationViewController(_:))

Presents a configuration view controller that lets the user configure the post.

[`popConfigurationViewController()`](/documentation/Social/SLComposeServiceViewController/popConfigurationViewController())

Dismisses the current configuration view controller.

### Responding to Lifecycle Events

[`presentationAnimationDidFinish()`](/documentation/Social/SLComposeServiceViewController/presentationAnimationDidFinish())

Tells the compose view controller that the presentation animation is finished.

[`didSelectCancel()`](/documentation/Social/SLComposeServiceViewController/didSelectCancel())

Sent to the compose view after the cancel animation finishes.

[`didSelectPost()`](/documentation/Social/SLComposeServiceViewController/didSelectPost())

Sent to the compose view after the post animation finishes.

### Canceling a Post

[`cancel()`](/documentation/Social/SLComposeServiceViewController/cancel())

Starts the animated dismissal of the compose view.

### Validating Content

[`charactersRemaining`](/documentation/Social/SLComposeServiceViewController/charactersRemaining)

The number of characters remaining in a custom character limit.

[`isContentValid()`](/documentation/Social/SLComposeServiceViewController/isContentValid())

A Boolean value that indicates whether the current content and attachments are valid.

[`validateContent()`](/documentation/Social/SLComposeServiceViewController/validateContent())

Performs validation of the current content and updates the state of the Post button, if appropriate.

### Previewing Attachments

[`loadPreviewView()`](/documentation/Social/SLComposeServiceViewController/loadPreviewView())

Loads a view that displays a preview of the attachments in the extension context.

### Enabling Text Autocompletion

[`autoCompletionViewController`](/documentation/Social/SLComposeServiceViewController/autoCompletionViewController)

The view controller that manages an autocompletion view for suggesting common text completions while users type.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)