I have this app called BzCalendar created sometime around the year 2011. So with Objective-C and NO storyboard. I'm in the process of converting into Swift with Storyboard, not done yet.
My app is a calendar app with daily, weekly and monthly view. Top configuration of the app. When I run iPhoneX simulator, top and bottom layout is not what apple want. At first I thought this is something have to do with the app programmatically setting view's frame. However It seems the issue is based on the fact my app always adjust the view content with the width "320" I suppose when iPhone5 or so come around, iOS comes with converting the view to 320 width to rescue the app not supporting newer screen size.
I check the size with code:
override func viewDidLayoutSubviews() {
print("frame: ", self.view.frame)
print("safeAreaInsets", self.view.safeAreaInsets)
}
The result: frame: (0.0, 0.0, 320.0, 485.0) safeAreaInsets UIEdgeInsets(top: 44.0, left: 0.0, bottom: 0.0, right: 0.0)
320! Now trying to run with iPhone8 frame: (0.0, 0.0, 320.0, 519.0) safeAreaInsets UIEdgeInsets(top: 20.0, left: 0.0, bottom: 0.0, right: 0.0)
Then I've created new project on XCode9 and made simple app: UITabBarController - UIViewController with the same test code above: The Result: frame: (0.0, 0.0, 375.0, 812.0) safeAreaInsets UIEdgeInsets(top: 44.0, left: 0.0, bottom: 83.0, right: 0.0)
Do anyone experienced the same kind of issue before and know what to do with this? I'm expecting 2 steps fixtures: 1) change xcode config? to use actual screen size. 2) do extra works needed for iPhoneX