The "Legal" label/button that shows in the bottom-left of the MKMapView is occluded by other content in my app. Previously I was able to move that label above my content by using the layoutMargins property. That doesn't work in iOS 11. I've also tried directionalLayoutMargins and additionalSafeAreaInsets with no luck. Is there a way to do this in iOS 11?
Here is the code which I've tried:
let occludedHeight = self.view.bounds.height - bottomCoveringView.frame.minY
let labelOffset = occludedHeight + 10
if #available(iOS 11, *) {
mapView.directionalLayoutMargins = NSDirectionalEdgeInsets(top: 0, leading: 0, bottom: labelOffset, trailing: 0)
self.view.directionalLayoutMargins = NSDirectionalEdgeInsets(top: 0, leading: 0, bottom: labelOffset, trailing: 0)
self.additionalSafeAreaInsets = UIEdgeInsets(top: 0, left: 0, bottom: labelOffset, right: 0)
mapView.preservesSuperviewLayoutMargins = true
} else {
mapView.layoutMargins = UIEdgeInsets(top: 0, left: 0, bottom: labelOffset, right: 0)
}