Xcode iOS how to get safe area top ,bottom ,right ,left value like this -> How to get height of topLayoutGuide?
// Inside your viewController
self.topLayoutGuide.length
The safe area defines the area within a view that isn't covered by a navigation bar, tab bar, toolbar, or other views a view controller might provide. iPhone.
You can disable safe area layout guide from storyboard for particular view controller. Select View Controller -> File Inspector (first tab) -> Use safe area layout guides (uncheck the checkbox).
Safe areas help you place your views within the visible portion of the overall interface. UIKit-defined view controllers may position special views on top of your content. For example, a navigation controller displays a navigation bar on top of the underlying view controller's content.
The safe area insets is a UIEdgeInsets
struct. You can access the components like this:
view.safeAreaInsets.left
view.safeAreaInsets.right
view.safeAreaInsets.top
view.safeAreaInsets.bottom
etc
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With