Skip to content
This repository was archived by the owner on May 4, 2022. It is now read-only.
This repository was archived by the owner on May 4, 2022. It is now read-only.

Xcode 11 simulator changed device screen layouts & no longer honors safe-area code #410

@rolinger

Description

@rolinger

THIS IS MORE AN FYI FOR THOSE STILL WORKING ON V1 APPS

Short description of the problem:

Xcode 11 simulator has now added window.outerHeight to all devices, reducing window.innerHeight by 20px on ALL iPhone and iOS types. Xcode 10 and lower did not use window.outerHeight and assigned the entire window height to window.innerHeight. This messes with screen layouts for Ionic v1 apps (maybe others too) that are analyzing inner/outer heights.. As well, Xcode 11 simulator does not honor safe-area code designed to keep apps below the notch on phones like iPhoneX/iPhone11

As you can imagine, if you can't trust what your apps looks like in Simulator how can you trust what it will really look like on real devices - and if you don't have every type of real device to test (which I don't) then you really risk deploying a prod app that doesn't render properly.

What behavior are you expecting?

Screen layouts are skewed and app is pushed up behind safe-area notch on iPhoneX/iPhone 11.

Steps to reproduce:

  1. Deploy v1 app to Xcode 11 simulator - any phone.

Details: XCode 11 Simulator Window Height:

For the window height issue, I use a custom frame for a map component on my app that sizes properly to any device screen layout. I had to modify it for Xcode 11 simulator because it without accounting for innerHeight it added a 20px buffer between the bottom the map frame to the bottom of the screen. To implement a fix for that I added the following:

  // use parseInt because some older phones would report heights as 49.5, or 43.2
  var statusBar = parseInt(document.getElementById('mapTitleBar').clientHeight) ;
  var tabBar = parseInt(document.getElementById('allTabsBar').clientHeight) ;
  var addressBar = parseInt(document.getElementById('map_addressFields').clientHeight) ;
  
  var totalBars = statusBar + tabBar + addressBar - deviceData.iosStatusBar ;
  var innerHeight = deviceData.windowInnerHeight  ;
  var outerHeight = deviceData.windowOuterHeight  ;
  if (outerHeight == 0) {
    var mapHeight = innerHeight - toolBars ;  // Xcode 10 and lower
  } else {
    var mapHeight = outerHeight - toolBars ;  // Xcode 11 and up.
  }
  document.getElementById("mapWrapper").style.height = mapHeight+"px" ;

Of course, there are other solutions for map wrappers/frames to auto fill the remainder of screens, but thats not the point here. I have mine for specific reasons and Apple has changed how it renders apps between Xcode 10 and Xcode 11 through the use of window.innerHeight for the first time.

Details: XCode 11 Simulator safe-area notch:

I have no solution for the safe-area problem. And this is frustrating because I can't see what my app is going to look like on various notch iPhones. And since I don't have 4 of every iPhone type (running iOS x10, x11, x12, x13) I can't see what my app will look like deployed across the various iOSs which risks there being a real issue when I deploy prod apps from Xcode 11.

I verified Xcode 10 Sim iPhoneX (iOS 11.4 and 12.4) against Xcode 11 Sim iPhoneX (iOS 11.4 & 12.4) and all devices on Xcode 10 rendered properly, but none rendered properly on Xcode 11. I did this check just to ensure it wasn't an iOS 12 vs 13 issue.

I rebuilt my app using cordova-plugin-ionic-webview, webview-plus and without any webview - it didn't matter. My app deployed to Xcode 11 simulator devices with the notch all showed my app status/menu bars pushed up behind the notch.

I need to find a way of Xcode 11 Sim iPhoneX iOS 12.4 app so that I can port the compiled version over to Xcode 10 simulators just to see if it renders correctly. Since you can't run iOS 13 on Xcode 10, I have to resort to testing only older iOS versions.

Does ANYONE have a solution for this?

PS: I will be testing my Xcode 11 Ionic v1 app later today on a real iPhone 11 to see if the Simulator issue is actually happening on real phones - I will report my findings then.

Which Ionic Version? 1.x or 2.x
Ionic v1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions