Is there a way to manipulate, move around the apple logo and "legal" text from the bottom of the mkmapview?
Kind of what google maps has.

Is there a way to manipulate, move around the apple logo and "legal" text from the bottom of the mkmapview?
Kind of what google maps has.

You can change it by setting the layoutMargins of the mapView. For example, this will move it out from the bottom:
mapView.layoutMargins.bottom = -100 // removes the 'legal' text
mapView.layoutMargins.top = -100 // prevents unneeded misplacement of the camera
If you are setting the mapView layoutMargins it will offset all the shown content in the map (centering on annotations and such).
If you want to only move the 2 items, I would suggest adding these Extensions:
extension MKMapView {
var logoView: UIView? {
for subview in subviews {
if String.init(describing: subview).localizedCaseInsensitiveContains("MKAppleLogoImageView") {
return subview
}
}
return nil
}
var legalView: UIView? {
for subview in subviews {
if String.init(describing: subview).localizedCaseInsensitiveContains("MKAttributionLabel") {
return subview
}
}
return nil
}
func moveLogoView(x: CGFloat, y: CGFloat) {
logoView?.moveOrigin(x: x, y: y)
}
func moveLegalView(x: CGFloat, y: CGFloat) {
legalView?.moveOrigin(x: x, y: y)
}
}
extension UIView {
func moveOrigin(x: CGFloat, y: CGFloat) {
let originX = self.frame.origin.x
let originY = self.frame.origin.y
self.frame.origin = CGPointMake(originX + x, originY + y)
}
}
Then, those can be used after the map was loaded. Works in viewDidLoad() with a DispatchQueue.main.asyncAfter or didLayoutSubviews()
mapView.moveLogoView(x: -40, y: 60)
mapView.moveLegalView(x: 20, y: 60)