---
title: "willTransition(to:)"
framework: messages
role: symbol
role_heading: Instance Method
path: "messages/msmessagesappviewcontroller/willtransition(to:)"
---

# willTransition(to:)

Tells the view controller that the extension is about to transition to a new presentation style.

## Declaration

```swift
func willTransition(to presentationStyle: MSMessagesAppPresentationStyle)
```

## Parameters

- `presentationStyle`: The new presentation style. For a list of possible styles, see doc://com.apple.messages/documentation/Messages/MSMessagesAppPresentationStyle.

## Discussion

Discussion Override this method to update your extension’s layout while the extension is transitioning between the MSMessagesAppPresentationStyle.compact and MSMessagesAppPresentationStyle.expanded styles. The user can switch between styles by tapping the collapse and expand buttons in the Messages app.  You can also programmatically trigger a transition by calling requestPresentationStyle(_:). The system doesn’t call this method on a view controller that is presenting a live view in the transcript or input field—in other words, when the view controller’s presentationStyle property is set to the MSMessagesAppPresentationStyle.transcript value. note: Because the keyboard is not available in the MSMessagesAppPresentationStyle.compact style, adding text fields or text views to your compact layout is not recommended.

## See Also

### Working with Presentation Styles and Contexts

- [presentationStyle](messages/msmessagesappviewcontroller/presentationstyle.md)
- [requestPresentationStyle(_:)](messages/msmessagesappviewcontroller/requestpresentationstyle(_:).md)
- [didTransition(to:)](messages/msmessagesappviewcontroller/didtransition(to:).md)
- [MSMessagesAppPresentationStyle](messages/msmessagesapppresentationstyle.md)
- [presentationContext](messages/msmessagesappviewcontroller/presentationcontext.md)
- [MSMessagesAppPresentationContext](messages/msmessagesapppresentationcontext.md)
