iPhone X safeAreaLayoutGuide

When I try to get the safe area I only receive the bounds of the whole screen until the device/simulator is rotated. After a rotation I get the correct safe area adjusted for the notch and home indicator. Does anyone know if we can use safeAreaLayoutGuide and get the correct results before a rotation?

//using SDL_SysWMinfo windowInfo
UILayoutGuide* guide = [windowInfo.info.uikit.window.rootViewController.view safeAreaLayoutGuide]

It seems like the safeAreaLayoutGuide is correct after SDL_CreateWindow but then incorrect after SDL_CreateRenderer.

I didn’t know UIWindow was a UIView. The layout guide seems to always be correct when taken from the window.

 [windowInfo.info.uikit.window safeAreaLayoutGuide]

Getting the safeAreaLayoutGuide from the UIWindow is probably not the best solution because it does not account for the status bar like the rootViewController’s view does. The safe area is also not correct for other iOS devices when the status bar is shown. Before SDL_CreateWindow getting the safe area is correct because it accounts for the status bar. After SDL_CreateRenderer the safe area is incorrect because it does not account for the status bar.