---
title: SLComposeViewController
framework: social
role: symbol
role_heading: Class
path: social/slcomposeviewcontroller
---

# SLComposeViewController

A view controller that allows the user to compose social media posts.

## Declaration

```swift
class SLComposeViewController
```

## Overview

Overview Use the isAvailable(forServiceType:) class method to check if a service account, such as Twitter, is set up and reachable before presenting this view to the user. Set the initial content before presenting the view controller to the user. All the methods that set the content of a post return a Boolean value. They return false if the content doesn’t fit in the post or if the view controller has already been presented to the user. You must set all of the content in the post before presenting the view controller to the user. After presenting the view controller, only the user can edit the post. You can set a handler—using the completionHandler property—to be notified when the user is done composing a post. Note that completion handlers are not called on any particular thread.

## Topics

### Creating a Social Compose View Controller

- [init(forServiceType:)](social/slcomposeviewcontroller/init(forservicetype:).md)

### Checking the Social Service Type

- [isAvailable(forServiceType:)](social/slcomposeviewcontroller/isavailable(forservicetype:).md)
- [serviceType](social/slcomposeviewcontroller/servicetype.md)

### Specifying the Contents of the Post

- [setInitialText(_:)](social/slcomposeviewcontroller/setinitialtext(_:).md)
- [add(_:)](social/slcomposeviewcontroller/add(_:)-1z68a.md)
- [add(_:)](social/slcomposeviewcontroller/add(_:)-3mn1w.md)
- [removeAllImages()](social/slcomposeviewcontroller/removeallimages().md)
- [removeAllURLs()](social/slcomposeviewcontroller/removeallurls().md)

### Processing the Results

- [completionHandler](social/slcomposeviewcontroller/completionhandler.md)
- [SLComposeViewControllerCompletionHandler](social/slcomposeviewcontrollercompletionhandler.md)
- [SLComposeViewControllerResult](social/slcomposeviewcontrollerresult.md)

## Relationships

### Inherits From

- [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)
- [NSExtensionRequestHandling](foundation/nsextensionrequesthandling.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [NSTouchBarProvider](appkit/nstouchbarprovider.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.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)
- [UIStateRestoring](uikit/uistaterestoring.md)
- [UITraitChangeObservable](uikit/uitraitchangeobservable-67e94.md)
- [UITraitEnvironment](uikit/uitraitenvironment.md)
- [UIUserActivityRestoring](uikit/uiuseractivityrestoring.md)

## See Also

### Composition Interfaces

- [SLComposeServiceViewController](social/slcomposeserviceviewcontroller.md)
