Skip to content

Conversation

@kim-seonwoo
Copy link
Member

👾 작업 내용

  • 이슈의 취지와 다르게 7개의 커스텀 팝업 알럿 창을 구현하였습니다.
  • ViewModifier를 이용하여 구현하였습니다.
  • 사용방법은 다음과 같습니다.
        .customAlert(
            isPresented: $viewModel.isPresented,
            customAlert: {
                CustomAlertView(
                    alertType: viewModel.alertType,
                    confirmBtn: CustomAlertButtonView(
                        buttonType: .Confirm,
                        alertType: viewModel.alertType,
                        isPresented: $viewModel.isPresented,
                        action: {}
                    ),
                    cancelBtn: CustomAlertButtonView(
                        buttonType: .Cancel,
                        alertType: viewModel.alertType,
                        isPresented: $viewModel.isPresented,
                        action: {}
                    )
                )
            }
        )
  1. view 최상단에 modifier를 선언합니다.
  2. isPresented와 같은 state bool 값을 선언하여 바인딩 하여 줍니다.
  3. alertType 부분에는 CustomAlertType에 구현된 enum 중 하나를 입력해 줍니다. 7개의 팝업 타입입니다.
enum CustomAlertType {
    case unlock
    case unlockComplete
    case insufficientPoints
    case usePoints
    case withdraw
    case challengeCreationComplete
    case logout
    }
  1. action: {} 부분에 해당 부분 버튼 클릭시 어떤 인터렉션이 일어날지 정의 해 주면 됩니다.

🚀 PR Point

  • enum return 으로 무리하게 하려다가 시간을 많이 낭비 했네요.. 하하
  • 현재는 마이 페이지 뷰 관련만 연결하 상태입니다. (로그아웃, 회원탈퇴)

📸 스크린샷

구현 내용 스크린샷
화면종류 Simulator Screen Recording - iPhone 13 mini - 2024-05-14 at 11 49 25

✅ CheckList

  • 오류 없이 빌드되는지 확인
  • 로그용 print문 제거
  • 불필요한 주석 제거
  • 코드 컨벤션 확인

🔗 Issue

Resolved #25

@kim-seonwoo kim-seonwoo added 😎선우 선우의 issue ✨FEAT 기능 구현 🎨STYLE 커스텀 뷰 짜기 labels May 14, 2024
@kim-seonwoo kim-seonwoo added this to the 🔭2차 스프린트🪐 milestone May 14, 2024
@kim-seonwoo kim-seonwoo requested a review from Zoe0929 May 14, 2024 02:50
@kim-seonwoo kim-seonwoo self-assigned this May 14, 2024
@kim-seonwoo kim-seonwoo linked an issue May 14, 2024 that may be closed by this pull request
1 task
Copy link
Member

@Zoe0929 Zoe0929 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 ViewModifier 구현 뚝 딱. 좋아요! 잘 사용하겠습니다~

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❓ 여기는 잘못 올린 것 같아요! 처음에는 LoginView()가 맞는 것 같습니다~

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아 정답입니다@!

Comment on lines +16 to +23
enum CustomAlertType {
case unlock
case unlockComplete
case insufficientPoints
case usePoints
case withdraw
case challengeCreationComplete
case logout
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 enum 이용한 야무진 구현 굳입니다 !!

Comment on lines 222 to 224
//
//Spacer()
// .frame(height: 36)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤧 주석 필요없다면 지워주세요~

@kim-seonwoo kim-seonwoo merged commit 42bbcdb into develop May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨FEAT 기능 구현 🎨STYLE 커스텀 뷰 짜기 😎선우 선우의 issue

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[Feat] 화면 전환 로직 연결

3 participants