MkMapView注解标题不显示

我在我的应用程序中使用mkmapview。 我在我的应用程序中显示注释。 但是注解标题没有显示在我的地图视图中。 这是我的代码:

func loadMaps(){ let shopsArray = self.locationlatlong as NSArray print(shopsArray) for shop in shopsArray { let annotation = MKPointAnnotation() let mylatitude : String = shop["letitude"] as! String let string = NSString(string: mylatitude) let mylatitudeFinal = string.doubleValue print(mylatitude) print(mylatitudeFinal) let mylongitude : String = shop["longitude"] as! String let string123 = NSString(string: mylongitude) let mylongitudeFinal = string123.doubleValue let location = CLLocationCoordinate2D( latitude: mylatitudeFinal, longitude: mylongitudeFinal ) print(location) annotation.coordinate = location annotation.title = shop["firstname"] as? String mapView?.addAnnotation(annotation) } 

那么我怎样才能在我的地图上显示注释标题?

Interesting Posts