This repository was archived by the owner on Oct 14, 2024. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds a back-compatible version of the safe area introduced in iOS 11.
The idea is to emulate this value for iOS < 11 using the AL values provided by the view controller.
When it is possible (iOS >= 11), the UIKit version is used. The reason why UIKit version is preferred is because this value will be especially important for the iPhone X, which only runs iOS 11 (or greater). UIKit version, in fact, also considers left/right constrains that basically always zero for other devices. According to Apple's videos, also, in the iPhone X the safe area is also used in table cells to avoid weird things when the iPhone is in landspace. While it is true that we don't generally support that orientation, using the UIKit version provides the support out of the box