Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iMessage App Expanded View Programmatically

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
    }
}
like image 376
Tom Coomer Avatar asked Sep 23 '26 07:09

Tom Coomer


1 Answers

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];
}
like image 79
KrishnaCA Avatar answered Sep 24 '26 21:09

KrishnaCA



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!