Landscape view of StoreSearch for iPhoneX

Hello, I currently have an issue with the landscape view on iPhone X to display the search results. The switch/case state doesn’t handle the width of the iPhone X view, so I don’t know which values to use for the buttons’ width/height and the margins ; and as the constraints are set by the frame of the view, the buttons are overlapped by the notch at the left of the screen, because the safe area is ignored…
I have no idea how to handle this issue programmatically…

The safe area was introduced to handle the iPhone X notch area. So if you have the auto layout constraints set correctly, the safe area should be respected. However, without actually looking at your project, I can’t tell you what is going on.

So could you please upload the project as a ZIP file somewhere and provide a link to it so that I can take a look at it to see what is going on?

Thank you for taking a look !
Here’s a link : https://drive.google.com/open?id=1XEW6ZYnbLjcscP-g3FMxkug8u2aSsXhK
The issue occurs in “LandscapeViewController”.

My apologies, I had forgotten that the landscape view uses custom layout so that you can learn about custom layout. Unfortunately, this would break on an iPhone X since it assumes that the left and right marigns are always at the edge of the screen.

So if you want to fix this for iPhone X, you would need to detect that you are on an iPhone X and then adjust the view frame as calculated on page 971 accordingly. I will update the book in the next release to fix this issue …

Ok, thank you for your time ! :+1:

This topic was automatically closed after 166 days. New replies are no longer allowed.