DeveloperAcademy-POSTECH / DeveloperAcademy-POSTECH/2026-C4-A06-FunFun
[refactor] MapPresentationState 으로 MapUI를 변경하는 방식 개선
- Dominant language
- Objective-C
- Stars
- 2
- Forks
- 0
- Avg merge
- 7h 12m
- Merged PRs (30d)
- 6
Description
# Background
## View가 UIKit으로된 MapSDK에 상태를 전달하는 방법
```mermaid
flowchart TD
App
subgraph ZStack
WalkingNavigationView
PersistentWalkingMapView
NaverMapRouteView
end
WalkingNavigationViewModel
App --> WalkingNavigationView <-->|ViewState| WalkingNavigationViewModel
WalkingNavigationViewModel --> ...
WalkingNavigationView -->|MapPresentationState 조립| PersistentWalkingMapView
PersistentWalkingMapView -->|MapPresentationState 전달| NaverMapRouteView
NaverMapRouteView -.->|MapPresentationState 콜백| WalkingNavigationView
NaverMapRouteView --> NaverMapSDK
```
MapPresentationState를 통해서 View는 변화된 상태를 Map에 상태를 전달한다. View의 기능이 많아질 수록, MapPresentationState는 계속 커지게 된다.
현재 `MapPresentationState`의 상태
```swift
struct MapPresentationState: Equatable {
let route: WalkingRoute?
let deviationPath: [Coordinate]
let passedRouteIndex: Int
let currentLocation: Coordinate?
let currentHeading: CLLocationDirection?
let currentLocationAccuracy: CLLocationAccuracy?
let navigationBearing: CLLocationDirection?
let navigationAlignmentID: Int?
let isNavigating: Bool
let cameraCommand: MapCameraCommand?
let showLandmarks: Bool
let landmarkScaleThreshold: Double
let showTurnMarkers: Bool
let showRoutePoints: Bool
let routePointRadius: Double
let approachingThreshold: Double
let selectedPlace: Place?
var onPlaceSelected: ((Place) -> Void)?
var onMapCleared: (() -> Void)?
var onMapViewportChanged: ((CLLocationDirection, CGPoint?) -> Void)? = nil
}
```
## State전달 플로우
View -> PersistentWalkingMapView (Map을 선택) -> MapRouteView (state를 받고 SDK의 함수를 실행)
# Target
상태를 전달하는 방식을 바꿔보기
- 현재 방식은 매우 직관적임, View는 변화를 넘겨주기만 하고 이를 MapView에서 알아서 처리
-
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by tracing MapPresentationState from WalkingNavigationView through PersistentWalkingMapView to NaverMapRouteView. Review how the state is assembled, passed, and converted into MapSDK calls, then define the intended replacement approach and its completion criteria; the issue does not yet specify what should change.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- mobile-dev
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100