Open ZevEisenberg opened 7 years ago
Clearly, the new approach is to use the safeAreaLayoutGuide on iOS 11+. We should also have something along these lines for all the hybrid anchors:
var safeCenterAnchors: AnchorPair<NSLayoutXAxisAnchor, NSLayoutYAxisAnchor> {
if #available(iOS 11.0, *) {
return AnchorPair(first: safeAreaLayoutGuide.centerXAnchor, second: safeAreaLayoutGuide.centerYAnchor)
}
else {
return centerAnchors
}
}
In order to do this in my app, I also had to add this to expose the internal
initializer:
extension AnchorPair {
init(first: T, second: U) {
self.first = first
self.second = second
}
}
Semi-duplicated by #59
Not sure what the right approach is. Do we have to use the new edge inset guide on the view?