2

I have the code below to handle the resizing when the user taps on the arrow in my iMessage app to transition to the expanded view, but how can I open the expanded view programmatically when the user segues to a new view controller in my iMessage app?

override func didTransition(to presentationStyle: MSMessagesAppPresentationStyle) {
    // Called after the extension transitions to a new presentation style.

    if presentationStyle == MSMessagesAppPresentationStyle.compact {
        //Resize Views
    }
}
Cœur
  • 37,241
  • 25
  • 195
  • 267
Tom Coomer
  • 6,227
  • 12
  • 45
  • 82

1 Answers1

9

Assuming that you are calling this in MessagesViewController, you can programatically open the expanded view in the following way:

Swift version:

if self.presentationStyle == MSMessagesAppPresentationStyle.compact {
    self.requestPresentationStyle(MSMessagesAppPresentationStyle.expanded)
}

Obj-C version:

if (self.presentationStyle == MSMessagesAppPresentationStyleCompact) {
    [self requestPresentationStyle:MSMessagesAppPresentationStyleExpanded];
}
KrishnaCA
  • 5,615
  • 1
  • 21
  • 31