iMessage has a bug where it doesn’t if you have something (like a search bar) pinned to the top of the view, it’s hides it when you transition from compact to expanded view.

imessage-navbar-bug.gif

The fix for now is to manually adjust the height on the top constraint so that when you are in expanded mode, you push it down beyond the navbar. Of course you will have to adjust this number slightly for older iPhones. But 88 seems standards for iPhone 6/7.

ViewController.m


@interface MessagesViewController ()
@property (nonatomic, strong) NSLayoutConstraint *topConstraint;
@end

-(void)willTransitionToPresentationStyle:(MSMessagesAppPresentationStyle)presentationStyle {
    // Called before the extension transitions to a new presentation style.
    
    // Use this method to prepare for the change in presentation style.

    switch (presentationStyle) {
        case MSMessagesAppPresentationStyleCompact: {
            self.topConstraint.constant = 0;
            [self.view setNeedsLayout];
            break;
        }
        case MSMessagesAppPresentationStyleExpanded: {
            self.topConstraint.constant = 88.0;
            [self.view setNeedsLayout];
            break;
        }

        default:
            break;
    }

}
Advertisements