StoreSearch Landscape Broken on iPhone 8,11,12,13 & Pro

Thanks for writing such an incredible book. I enjoyed coding along with each project and gaining better insight into how things work in UIKit. One thing I found especially helpful is your consistent focus on optionals throughout the book. This was incredibly useful and a true breakthrough for me.

I just completed chapter 42 and adjusted StoreSearch to accommodate the iPad and iPhone 8 Plus. Unfortunately, landscapeVC does not present correctly on other phones with notches (iPhone 11-13, 11-13 Pro). There’s excess space between each page. Please let us know if you decide to update the book at a later date to optimize for some of the newer iPhones. Thanks again!

image

image

image

@fahim any suggestions?

Thank you for the kind words about UIKit Apprentice :slightly_smiling_face: It’s always gratifying to hear that somebody found the book helpful.

Regarding landscape view at the end of Chapter 42, the screen should look like the following for iPhone SE and iPhone 8 — which I think you have correct:
Simulator Screen Shot - iPhone SE (3rd generation) - 2022-06-15 at 04.36.12

However, at the end of that chapter, the landscape view for bigger screens should look like this:
Simulator Screen Shot - iPhone 11 - 2022-06-15 at 04.36.16

So just trying to clarify here — did you complete the chapter? Or are you partway through before adding the size class specific changes? Because if you did make the size class specific changes, then something went wrong …

You might want to compare your final result against the final project source code or go through the steps in the “Size classes in the storyboard” section again and make sure that you followed the steps correctly …

If it still doesn’t work correctly for you after that, please upload your current project as a ZIP file and I will take a look.

1 Like

Sorry for the delayed response. I must not have email notification setup with raywenderlich.

Yes, I completed the entire book through the last chapter. My iPhone SE and iPhone 8 screens look just like the one you show above. And the bigger screens do so as well. This applies to portrait and landscape mode.

However, the issue surfaces when I run sim with iPhone 11 Pro in landscape. Run the final chapter 42 source code provided with the book and you’ll see the same issue pops up - large gaps between the scrolling pages appear. Take a look at screenshots below of iPhone 11 sim run with chapter 42 final source code. Gaps highlighted with pink rectangle.

I didn’t mention this in the original post but there’s another issue I just noticed. When I run the chapter 42 final source code with iPhone 8 sim, it’s easy to swipe too fast and accidentally scroll up which completely hides 3+ rows of results. In fact, you can just scroll directly up as well and lose rows of results. Take a look at the last screenshot below. Is this due to the size of the container or something else?

First Page - iPhone 11 Pro
image

Second page - iPhone 11 Pro
image

Third page - iPhone 11 Pro
image

Second Page - iPhone SE
image

@fahim any suggestions?

It sounds as if this only happens for the Pro devices and everything else works correctly. So I would assume that there’s an issue with detecting the Pro device screen sizes correctly and/or trying to get the screen layout values correctly for the Pro device.

I’d have to go through the relevant chapter and code to see what is going on and unfortunately, I’m not in a position to do so immediately. Will post an update here when I can look at the code and figure out what’s going on.

1 Like