所以我的代码工作正常,但我的记录器充满了这个消息.有没有办法摆脱它或抑制它?
PostAnnotation.swift
class PostAnnotation: MKPointAnnotation {
//MARK: properties
let post: Post
//MARK: initialization
init(post: Post) {
self.post = post
super.init()
self.coordinate = CLLocationCoordinate2D(latitude: post.latitude, longitude: post.longitude)
self.title = post.title
self.subtitle = post.timeString()
}
}
Run Code Online (Sandbox Code Playgroud)
添加注释
let annotation = PostAnnotation(post: post)
self.map.addAnnotation(annotation)
Run Code Online (Sandbox Code Playgroud)
func mapView
func mapView(_ mapView: MKMapView, viewFor annotation: MKAnnotation) -> MKAnnotationView? {
if annotation is MKUserLocation {
return nil
}
var annotationView = mapView.dequeueReusableAnnotationView(withIdentifier: "pin") as? MKPinAnnotationView
if annotationView == nil {
annotationView = MKPinAnnotationView(annotation: annotation, reuseIdentifier: "pin")
} …Run Code Online (Sandbox Code Playgroud)