---
title: SLComposeServiceViewController
framework: social
role: symbol
role_heading: Class
path: social/slcomposeserviceviewcontroller
---

# SLComposeServiceViewController

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

## Declaration

```swift
class SLComposeServiceViewController
```

## Overview

Overview The 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 NSExtensionContext object.

## Topics

### Configuring the Post Details

- [configurationItems()](social/slcomposeserviceviewcontroller/configurationitems().md)
- [SLComposeSheetConfigurationItem](social/slcomposesheetconfigurationitem.md)
- [reloadConfigurationItems()](social/slcomposeserviceviewcontroller/reloadconfigurationitems().md)

### Managing the Contents of the Post

- [contentText](social/slcomposeserviceviewcontroller/contenttext.md)
- [placeholder](social/slcomposeserviceviewcontroller/placeholder.md)
- [textView](social/slcomposeserviceviewcontroller/textview.md)

### Presenting the View Controller

- [pushConfigurationViewController(_:)](social/slcomposeserviceviewcontroller/pushconfigurationviewcontroller(_:).md)
- [popConfigurationViewController()](social/slcomposeserviceviewcontroller/popconfigurationviewcontroller().md)

### Responding to Lifecycle Events

- [presentationAnimationDidFinish()](social/slcomposeserviceviewcontroller/presentationanimationdidfinish().md)
- [didSelectCancel()](social/slcomposeserviceviewcontroller/didselectcancel().md)
- [didSelectPost()](social/slcomposeserviceviewcontroller/didselectpost().md)

### Canceling a Post

- [cancel()](social/slcomposeserviceviewcontroller/cancel().md)

### Validating Content

- [charactersRemaining](social/slcomposeserviceviewcontroller/charactersremaining.md)
- [isContentValid()](social/slcomposeserviceviewcontroller/iscontentvalid().md)
- [validateContent()](social/slcomposeserviceviewcontroller/validatecontent().md)

### Previewing Attachments

- [loadPreviewView()](social/slcomposeserviceviewcontroller/loadpreviewview().md)

### Enabling Text Autocompletion

- [autoCompletionViewController](social/slcomposeserviceviewcontroller/autocompletionviewcontroller.md)

## Relationships

### Inherits From

- [NSViewController](appkit/nsviewcontroller.md)
- [UIViewController](uikit/uiviewcontroller.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSCoding](foundation/nscoding.md)
- [NSEditor](appkit/nseditor.md)
- [NSExtensionRequestHandling](foundation/nsextensionrequesthandling.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [NSSeguePerforming](appkit/nssegueperforming.md)
- [NSStandardKeyBindingResponding](appkit/nsstandardkeybindingresponding.md)
- [NSTextDelegate](appkit/nstextdelegate.md)
- [NSTextViewDelegate](appkit/nstextviewdelegate.md)
- [NSTouchBarProvider](appkit/nstouchbarprovider.md)
- [NSUserActivityRestoring](appkit/nsuseractivityrestoring.md)
- [NSUserInterfaceItemIdentification](appkit/nsuserinterfaceitemidentification.md)
- [UIActivityItemsConfigurationProviding](uikit/uiactivityitemsconfigurationproviding.md)
- [UIAppearanceContainer](uikit/uiappearancecontainer.md)
- [UIContentContainer](uikit/uicontentcontainer.md)
- [UIFocusEnvironment](uikit/uifocusenvironment.md)
- [UIPasteConfigurationSupporting](uikit/uipasteconfigurationsupporting.md)
- [UIResponderStandardEditActions](uikit/uiresponderstandardeditactions.md)
- [UIScrollViewDelegate](uikit/uiscrollviewdelegate.md)
- [UIStateRestoring](uikit/uistaterestoring.md)
- [UITextViewDelegate](uikit/uitextviewdelegate.md)
- [UITraitChangeObservable](uikit/uitraitchangeobservable-67e94.md)
- [UITraitEnvironment](uikit/uitraitenvironment.md)
- [UIUserActivityRestoring](uikit/uiuseractivityrestoring.md)

## See Also

### Composition Interfaces

- [SLComposeViewController](social/slcomposeviewcontroller.md)
