1
내 calloutAccessoryControllerTapped에 문제가 있습니다. 분당 내 설명 표 내에 두 개의 버튼이 있습니다. 각 버튼은 내지도보기에서 모달 팝업으로 이어집니다. 잠시 후 내 segue는 작동하지만 두 버튼 모두 같은 팝업으로 이어집니다. 나는 버튼과 그들의 구별을 구별 할 수 있어야한다.지도 - calloutAccessoryControllerTapped
이것이 가능합니까? 나는이 질문을 검색 좀 많은 답변이 유형의이 오류와 함께오고있다 "값 그러나
if (control == view.leftCalloutAccessoryView) {
아래 코드 줄을 사용하는 것이 좋습니다 것 '의 UIView는'어떤 회원이 없습니다 'leftCalloutAccessoryView'. 정말 것 누군가가이 문제를 도와 줄 수 있다면 감사하고 나는 명확하게 문제를 설명하지 않은 경우 사과, 나는 나의 최고의 정도 수행 한 다음
내 코드입니다. 간단한func mapView(_ mapView: MGLMapView, annotationCanShowCallout annotation: MGLAnnotation) -> Bool {
return true
}
func mapView(_ mapView: MGLMapView, annotation: MGLAnnotation, calloutAccessoryControlTapped control: UIControl) {
self.performSegue(withIdentifier: "Show", sender: view)
}
func mapView(_ mapView: MGLMapView, rightCalloutAccessoryViewFor annotation: MGLAnnotation) -> UIView? {
guard let skateAnnotation = annotation as? SkateAnnotation else { return nil }
if skateAnnotation.canEdit {
return UIButton(type: .detailDisclosure)
}
return nil
}
func mapView(_ mapView: MGLMapView, leftCalloutAccessoryViewFor annotation: MGLAnnotation) -> UIView? {
return UIButton(type: .contactAdd)
}
func mapView(_ mapView: MGLMapView, imageFor annotation: MGLAnnotation) -> MGLAnnotationImage? {
return nil
}
}
대단히 감사합니다. 그게 바로 제가 찾고 있던 것입니다. 많이 고맙습니다! – Cal
괜찮 으면 대답을 수락하십시오. 모두 도움이됩니다. – Magnas
스택 오버플로가 있음을 알지 못했습니다! 나는 새로운 사람이다! – Cal