[Feat] 광진구 버스 종합, 위치 기반 버스 정류장 검색 기능 구현#1
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughAdds .gitignore, introduces core data/models and managers for bus stops and location, scaffolds an API manager, creates a new Xcode unit-test target, and adds comprehensive tests for BusStopManager and LocationManager. BusStopManager loads/parses CSV, groups stops, and computes nearest stop asynchronously with published state updates. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User
participant UI
participant BusStopManager
participant FileSystem as CSV File
participant BG as Background Thread
participant Main as Main Thread
User->>UI: Request nearest stop
UI->>BusStopManager: findNearestStop(userLocation)
alt First use (no data)
BusStopManager->>FileSystem: Load CSV (primary/fallback path)
FileSystem-->>BusStopManager: Rows
BusStopManager->>BusStopManager: Parse + Group stops
end
BusStopManager->>BG: Compute nearest among groups
BG-->>BusStopManager: Nearest stop + routes
BusStopManager->>Main: Update isLoading=false, nearestStop
Main-->>UI: Render nearest stop
note over BusStopManager,BG: isLoading=true during async search
sequenceDiagram
autonumber
actor User
participant App
participant LocationManager
participant CoreLocation as CLLocationManager
User->>App: Request location
App->>LocationManager: requestPermission()
LocationManager->>CoreLocation: requestWhenInUseAuthorization()
CoreLocation-->>LocationManager: Authorization status
alt Authorized
LocationManager->>CoreLocation: startUpdatingLocation()
CoreLocation-->>LocationManager: didUpdateLocations([CLLocation])
LocationManager->>App: onLocationUpdate(first fix)
LocationManager->>CoreLocation: stopUpdatingLocation()
else Denied/Restricted
LocationManager->>App: showPermissionAlert=true
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~30 minutes Poem
Pre-merge checks and finishing touches and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
Comment |
개요
사용자의 현재 위치를 기반으로 가장 가까운 버스 정류장을 찾고, 해당 정류장을 지나는 버스 노선 정보를 제공하는 기능을 구현했습니다.
수정사항
1. 모델 추가
BusStop: 버스 정류장 정보를 담는 기본 모델StopWithRoutes: 정류장과 해당 정류장을 지나는 버스 노선 정보를 함께 관리하는 모델2. 매니저 구현
LocationManager: 사용자의 위치 권한 요청 및 실시간 위치 추적 기능BusStopManager: CSV 데이터 기반 정류장 검색 및 관리APIManager: 향후 API 연동을 위한 기본 구조3. 데이터 추가
bus_route_stops.csv: 버스 정류장 및 노선 데이터 (209개 항목)4. 테스트 코드 작성
LocationManagerTests: 위치 관리 기능 테스트 (9개 테스트)BusStopManagerTests: 정류장 검색 기능 테스트 (6개 테스트)5. 프로젝트 설정
ComfortableMoveTest추가.gitignore추가 (macOS, Xcode 관련 파일)테스트 커버리지
Summary by CodeRabbit
New Features
Tests
Chores