View getting hidden when changing presentation style

When I change from compact to expanded presentaion style in my iMessage extension the top part of the view is getting hidden behind the navigation bar. How can I prevent this?

Replies

I believe it is by design as the top bar is not opaque and part of your view can be seen through the top header.


Use the ViewController's topLayoutGuide.length to determine how much of your view is obstructred to position the elements correctly to be visible.

My app is storyboarded. Is there an easy way to fix this in the storyboard?

Open up the simulator and fire up Apple's #images sample iMessage app. The search bar seamlessly makes the transition to expanded when clicked. That's what I'm going for

Here's the weird thing: it happens with my search bar but not with my collection view. Both have the constraint top to top layout guide = 0

Hello Styshka:


This been happen since Beta 2. It happens intermittently. Sometimes it help to reset the simulator and close the simulator and restart the extension again from xcode. We have learn to live with it until it is fixed.


Hope that helps you, Henry

It's being discussed in https://forums.developer.apple.com/thread/52049 with source example as well