• select를 했을 때 selectedAnnotations 배열은 항상 하나의 annotation 만 가지고 (맨 첫번째 selectedAnnotation을 내뱉는 듯 하다

  • 실험결과 mapkit의 annotation은 기본적으로 “하나”만 선택가능하다

  • 하지만 포커싱을 위해 임의로 select해주는 메소드를 넣었더니 예상과 다르게 동작함

    스크린샷 2023-12-07 오후 9.35.20.png

    • 단일 선택만 가능하다면 아래와 같은 코드는 왜 동작하지 않는 걸까?
    if let selectedAnnotation = mapView.selectedAnnotations.first {
            mapView.deselectAnnotation(selectedAnnotation, animated: true)
    }
    mapView.selectAnnotation(focusedAnnotaion, animated: true)
    

    … 문제를 알았다

    • 맵 핀을 선택하면, scrollToItem으로 그 영상까지 가게되는데 그 과정에서 지나치는 셀들이 다 select가 되면서 모든 맵핀이 선택되는거였음………………….. 그게 annotations에 들어가게되는거고.. 진짜 바보가 아닐 수 없다.. ……………………