0

I'm developing iMessage Extension app with Swift 3(iOS 10). But my problem is that when user changed mode from collapse to expand or expand to collapse, the top constraint is changing so the view is hidden.

From this reference, Why is the top layout guide moving in my iMessage extension, I fixed issue (issue is that when user present view controller so the view will be get hidden) but when changing mode, it doesn't work and view get hidden.

Is there anybody who has experience in this area?

Community
  • 1
  • 1
Ioan Moldovan
  • 2,272
  • 2
  • 29
  • 54

1 Answers1

0

I'm not sure why it behaves like this, it seems like a bug on Apple side. However the root MSMessageViewController is aligned properly, also it looks like only the root view controller receives notifications like didTransitionToPresentationStyle or didSelectMessage.

In my app I decided to:

  • add MSMessageViewController view as a subview of the root controller - for controllers that needs to work in fullscreen and compact style.

  • For MSMessageViewControllers that are presented only in fullscreen mode I ended up adding in storyboard top margin constraint with fixed value. Also whenever didTransitionToPresentationStyle is called with presentation style compact those controllers are dismissed.

Also for convenience I created singleton object that receives all transitioning events and allows any view controller to subscribe as delegate

Related discussion on Apple Developer Forum: https://forums.developer.apple.com/thread/65349

MP23
  • 1,763
  • 20
  • 25
  • Hi, Thank you for your answer. Sorry but can you please give me more details about your solution? I'm until not sure how to solve this. – Ioan Moldovan Oct 22 '16 at 00:01