78: Time for MapKit

그루두·2024년 7월 28일
0

100 days of SwiftUI

목록 보기
86/108

Time for MapKit

challenge

But your boss has come in and demanded a new feature: when you’re viewing a picture that was imported, you should show a map with a pin that marks where they were when that picture was added. It might be on the same screen side by side with the photo, it might be shown or hidden using a segmented control, or perhaps it’s on a different screen – it’s down to you. Regardless, you know how to drop pins, and you also know how to use the center coordinate of map views, so the only thing left to figure out is how to get the user’s location to save alongside their text and image.

solution

  1. class LocationFetcher 설정하기
  2. Photolocation 속성 추가해서, 사진 저장할 때 위치가 저장되게 하기
  3. MapView를 만들어서 photos의 위치대로 지도에 나타내기
  4. 기존 ContentView는 GridView로 옮기기
  5. ContentView를 탭으로 GridView와 MapView로 나타내기

마지막 커밋 링크
💡 과정은 commit history에서 확인할 수 있습니다.

결과물

profile
계속 해보자

0개의 댓글

관련 채용 정보