So my code works fine but my logger is riddled with this message. Is there a way to get rid of it or suppress it?
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()
}
}
Adding the annotation
let annotation = PostAnnotation(post: post)
self.map.addAnnotation(annotation)
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")
} else {
annotationView?.annotation = annotation
}
if let annotation = annotation as? PostAnnotation {
annotationView?.pinTintColor = UIColor.blue
annotationView?.canShowCallout = true
annotationView?.rightCalloutAccessoryView = UIButton(type: .infoLight)
annotationView?.animatesDrop = true
}
return annotationView
}
Removing this function removes the message
This is a bug in iOS 11, since MKLayer
is not a public class.
I'd simply ignore the message, but if it's bothering you: To silence this warning, you can set OS_ACTIVITY_MODE=disable
in the scheme's environment page. Beware though, you will silence other OS warnings as well.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With