Get safe area inset top and bottom heights

Try this : In Objective C if (@available(iOS 11.0, *)) { UIWindow *window = UIApplication.sharedApplication.windows.firstObject; CGFloat topPadding = window.safeAreaInsets.top; CGFloat bottomPadding = window.safeAreaInsets.bottom; } In Swift if #available(iOS 11.0, *) { let window = UIApplication.shared.keyWindow let topPadding = window?.safeAreaInsets.top let bottomPadding = window?.safeAreaInsets.bottom } In Swift – iOS 13.0 and above // Use the first … Read more

Safe Area of Xcode 9

Safe Area is a layout guide (Safe Area Layout Guide). The layout guide representing the portion of your view that is unobscured by bars and other content. In iOS 11+, Apple is deprecating the top and bottom layout guides and replacing them with a single safe area layout guide. When the view is visible onscreen, … Read more