2

MKMapview have legal link on its bottomright point. I want to add a button on this place. the button have some kind of transparency. can I hide the legal link? Or if i set my buttons in a way that hide this link may apple reject my app?

I also have some kinds of subviews in my map view.

Husein Behboudi Rad
  • 5,434
  • 11
  • 57
  • 115

5 Answers5

4

Try to use this one but i don't know apple will approve or not.

[[self.mapView.subviews objectAtIndex:1] removeFromSuperview];
Dharmbir Singh
  • 17,485
  • 5
  • 50
  • 66
3

Removing the label will probably lead to your app getting rejected. However it can be done like this with swift:

var legalLabel: UIView?
for subview in stableMapView.subviews {
    if String(describing: type(of: subview)) == "MKAttributionLabel" {
        legalLabel = subview
    }
}
legalLabel?.isHidden = true
Simon Bengtsson
  • 7,573
  • 3
  • 58
  • 87
2

You SHOULD NOT hide this legal link or your app will be rejected by Apple.

EDIT : I've found a category wich allows you to move this link, I'm not the author : https://github.com/bartvandendriessche/MKMapView-AttributionView

R.Lambert
  • 1,160
  • 1
  • 11
  • 25
  • can you add some link to prove your answer? – rptwsthi Apr 22 '13 at 15:48
  • 1
    Sure, https://developer.apple.com/library/ios/#documentation/MapKit/Reference/MKMapView_Class/MKMapView/MKMapView.html#//apple_ref/doc/uid/TP40008205 OR http://rogchap.com/2011/06/17/mkmapview-moving-the-google-logo/ – R.Lambert Apr 23 '13 at 07:25
  • 1
    I see no reference to the legal annotation in the Apple docs. The second link is dead – Airsource Ltd Dec 14 '16 at 11:35
0

More safe version:

extension MKMapView {
    var attributedView: UIView? {
        for subview in subviews {
            if String(describing: type(of: subview)).contains("Label") {
                return subview
            }
        }
        return nil
    }

    func hideAttributedView() {
        guard let attributedView = attributedView else {
            return
        }
        attributedView.isHidden = true
    }
}
Michal Zaborowski
  • 5,039
  • 36
  • 35
0

Easiest way to hide the apple logo and legal text in the map (MapView).

To hide the apple logo in the map.

mapView.subviews[1].isHidden = true

To hide the legal text

mapView.subviews[2].isHidden = true
handiansom
  • 783
  • 11
  • 27