:
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
}
}