Open chaneeii opened 1 year ago
보라색 워닝이 뜸
원인
이쪽코드에서 viewModel 에 바인딩된 내용을 다루면서 발생
struct MapView: View { @EnvironmentObject private var viewModel: MapViewModel @State private var showFabAnimation = false var body: some View { ZStack { Map(coordinateRegion: $viewModel.mapRegion, showsUserLocation: true, annotationItems: viewModel.places, annotationContent: { location in MapAnnotation(coordinate: location.coordinates) { PinView(category: location.category) .scaleEffect(viewModel.selectedPlace == location ? 1 : 0.75) .onTapGesture { viewModel.updateSelectedPlace(place: location) } } }) .ignoresSafeArea() .onAppear { viewModel.checkIfLocationServicesIsEnabled() } fabButton } } }
현재 상황에 대해 잘 정리해둔글
MapKit 에서 똑같은 상황을 겪고 있는 사람
바인딩으로 넘겨주는 값을 아래와 같이 get set해주었더니 처리가 되었습니다 즉, 새로운 값을 받았을떄 main 에서 넣어준다는 원리
맵마커 커스텀을 위한 MapAnnotation 을 쓰면 보라색 경고가뜬다 (-> 공식문서도 에러를 낸다,,)
MapMarker를 쓰면 멀쩡하다
(진짜.. 이거 또안되면 애플공식문서에 이슈랑 pr 올릴예정)
버그 설명
보라색 워닝이 뜸
원인
이쪽코드에서 viewModel 에 바인딩된 내용을 다루면서 발생
내용
현재 상황에 대해 잘 정리해둔글
MapKit 에서 똑같은 상황을 겪고 있는 사람
스크린샷