3.5 KiB
3.5 KiB
20260313 토스트 비차단 표시 통일
- 토스트 공통 구현/사용 지점 탐색
- 비차단 토스트 표시 정책(동적 아일랜드형 또는 하단 슬라이드형) 선택 및 공통 적용
- 기존
.popup(... type: .toast ...)사용처가 공통 정책을 따르도록 정리 - 정적 진단/빌드/테스트 검증 수행 및 결과 기록
검증 기록
1차
- 무엇/왜/어떻게: 기존
PopupView기반 토스트 호출을 전역에서 제거하고, 비차단 Dynamic Island 형태의 공통 토스트 modifier(sodaToast)로 통일했다. 토스트 표시 중 스크롤/입력을 막지 않도록 오버레이에allowsHitTesting(false)를 적용했다. - 실행 명령:
- 전역 호출 치환/검증
grep(pattern="\\.popup\\(", path="SodaLive/Sources", include="*.swift")→ 결과 없음grep(pattern="\\.sodaToast\\(", path="SodaLive/Sources", include="*.swift")→ 99개 호출 확인
- 빌드
xcodebuild -workspace "SodaLive.xcworkspace" -scheme "SodaLive" -configuration Debug buildxcodebuild -workspace "SodaLive.xcworkspace" -scheme "SodaLive-dev" -configuration Debug build
- 테스트
xcodebuild -workspace "SodaLive.xcworkspace" -scheme "SodaLive" testxcodebuild -workspace "SodaLive.xcworkspace" -scheme "SodaLive-dev" test
- 정적 진단
lsp_diagnostics:SodaLive/Sources/Common/BaseView.swift,SodaLive/Sources/Search/SearchView.swift,SodaLive/Sources/Content/Main/V2/Replay/ContentMainTabReplayView.swift
- 전역 호출 치환/검증
- 결과:
.popup(... type: .toast ...): 전역 0건 확인.sodaToast(...): 전역 99건 적용 확인SodaLiveDebug 빌드: 성공(** BUILD SUCCEEDED **)SodaLive-devDebug 빌드: 성공(** BUILD SUCCEEDED **)SodaLive테스트: 실패 -Scheme SodaLive is not currently configured for the test action.SodaLive-dev테스트: 실패 -Scheme SodaLive-dev is not currently configured for the test action.lsp_diagnostics: SourceKit 로컬 해석 한계로 모듈/심볼 미해결 오류가 출력되었으나, 실제 Xcode 빌드는 양 스킴 모두 성공
2차
- 무엇/왜/어떻게: 사용자 추가 요청에 따라 토스트 배경색을
#3BB9F1로 변경하고, 기존 투명도(0.92)를 동일하게 유지했다. - 실행 명령:
- 정적 진단
lsp_diagnostics:SodaLive/Sources/Common/BaseView.swift
- 빌드
xcodebuild -workspace "SodaLive.xcworkspace" -scheme "SodaLive" -configuration Debug build
- 테스트
xcodebuild -workspace "SodaLive.xcworkspace" -scheme "SodaLive" test
- 정적 진단
- 결과:
SodaLive/Sources/Common/BaseView.swift진단: 오류 없음SodaLiveDebug 빌드: 성공(** BUILD SUCCEEDED **)SodaLive테스트: 실패 -Scheme SodaLive is not currently configured for the test action.
다른 UI에서 사용 방법
- 토스트가 필요한 View에 아래 형태로 동일하게 적용한다.
.sodaToast(
isPresented: $viewModel.isShowPopup,
message: viewModel.errorMessage,
autohideIn: 2
)
- 파라미터 규칙
isPresented: 표시 상태 바인딩 (Binding<Bool>)message: 사용자에게 노출할 문자열autohideIn: 자동 숨김 초(기본값2)
- UI 정책
- 위치/스타일은 공통 Dynamic Island 형태로 고정되어 별도 커스터마이즈 없이 동일 UX를 유지한다.
- 터치 차단이 없도록 구현되어 토스트 표시 중에도 스크롤/텍스트 입력이 가능하다.