[FEAT] 공용 모달 뷰 구현 - #12
Open
dlrjswns wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe
공통으로 사용할 수 있는
ModalContainerView를 구현했습니다. 하나의 공통 컴포넌트로 분리하여 모달의 공통적인 동작을 재사용할 수 있도록 개선했습니다.Works made
구현 내용
@ViewBuilder를 사용하여 모달 내부 UI를 자유롭게 구성할 수 있도록 지원@Binding을 통해 부모 View에서 모달 표시 여부를 제어할 수 있도록 구현dismissOnBackgroundTap옵션 제공사용 예시
Changes Made
As-Is
기존 로직
없음
스크린샷
To-Be
변경 로직
ModalContainerView에서 모달의 공통 동작을 담당하도록 변경했습니다.스크린샷
Simulator.Screen.Recording.-.iPhone.17.Pro.-.2026-08-04.at.11.18.36.mov
How to Test
@State로 모달 표시 여부를 관리합니다.ModalContainerView(isPresented:)를 생성합니다.Issues Resolved
Additional context
ModalContainerView는 공통 Container 역할만 담당하며 실제 모달 UI는 외부에서 주입받는 구조입니다.이를 통해 Alert, Confirm, Error, Logout 등 다양한 모달을 동일한 방식으로 구현할 수 있으며 공통 로직 변경 시 하나의 컴포넌트만 수정하면 되어 유지보수성을 높일 수 있습니다.
References