ios - MKAnnotationView layer is not of expected type: MKLayer -


so code works fine logger riddled message. there way rid of 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 annotation

let annotation = postannotation(post: post) self.map.addannotation(annotation) 

func mapview

func mapview(_ mapview: mkmapview, viewfor annotation: mkannotation) -> mkannotationview? {      if annotation 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 function removes message

this bug in ios 11, since mklayer not public class.

i'd ignore message, if it's bothering you: silence warning, can set os_activity_mode=disable in scheme's environment page. beware though, silence other os warnings well.

scheme editor


Comments

Popular posts from this blog

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -