Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat[#61] myPageLogoutAndQuit 뷰 연결 #65

Merged
merged 4 commits into from
Jan 13, 2024

Conversation

boyeon0119
Copy link
Contributor

👾 작업 내용

  • 마이페이지에 있는 로그아웃 버튼회원탈퇴 버튼 선택 시, 커스텀 알럿창이 버튼에 맞게 뜨도록 뷰를 연결하였습니다.
  • 그리고 알럿창의 닫기 버튼 선택 시에는 마이페이지로 창이 닫히고, 확인 버튼 선택 시에는 로그인 뷰로 이동하도록 연결하였습니다.

🚀 PR Point

버튼 이벤트

  • 푸터에 있는 로그아웃 버튼과 회원탈퇴 버튼의 액션에 커스텀 알럿 뷰컨트롤러와 연결한다는 액션을 추가했습니다.
// 버튼에 따른 동작을 위한 if문
@objc func tap (button: UIButton) {
        if button == logoutButton {
            (동작 추가)
        }
        else if button == quitButton {
            (동작 추가)
    }
// 버튼 선택 시, 알럿뷰컨과 연결한다는 이벤트 코드
var responder: UIResponder? = self
            while responder != nil {
                responder = responder?.next
                if let viewController = responder as? UIViewController {
                    let alertController = AlertViewController()
                    alertController.setAlertType(.HMHLogoutAlert)
                    alertController.modalPresentationStyle = .overFullScreen
                    viewController.present(alertController, animated: false, completion: nil)
                    break
                }
            }

확인 버튼 선택 시, 로그인 뷰로 이동

  • 로그아웃과 회원탈퇴 확인 버튼 선택 시, 둘다 로그인 뷰로 이동하는 이벤트를 구현했습니다.
  • 연결할 서버가 달라 추후에 서버 통신할 때는 버튼 메서드를 수정할 예정입니다.
func enabledButtonTapped() {
        dismiss(animated: false) {
            let loginViewController = LoginViewController()
            
            if let window = UIApplication.shared.windows.first {
                let navigationController = UINavigationController(rootViewController: loginViewController)
                navigationController.isNavigationBarHidden = true
                window.rootViewController = navigationController
                window.makeKeyAndVisible()
            }
        }
    }

📸 스크린샷

구현 내용 스크린샷
로그아웃과 회원탈퇴

🚀 기기 대응

기기명 Iphone 13 mini Iphone 14 Iphone 15 pro Iphone SE(3rd)
스크린샷

✅ Issue

Resolved #61

@boyeon0119 boyeon0119 added 🙊보연 보연의 issue 🌈 feat 기능 구현 labels Jan 12, 2024
@boyeon0119 boyeon0119 added this to the 🚀1차 스프린트🚀 milestone Jan 12, 2024
@boyeon0119 boyeon0119 self-assigned this Jan 12, 2024
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.

아주 좋습니다 금요일 아주 고생했습니다.

Copy link
Member

@kim-seonwoo kim-seonwoo left a comment

Choose a reason for hiding this comment

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

WFM

@@ -84,11 +84,21 @@ final class AlertViewController: UIViewController {
extension AlertViewController: AlertDelegate {
func enabledButtonTapped() {
dismiss(animated: false) {
(self.okAction ?? self.emptyActions)()
let loginViewController = LoginViewController()
Copy link
Member

Choose a reason for hiding this comment

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

p2. 이 부분 UIViewController+ extension 이용하여 간결하게 바꿔주세요🙏

@boyeon0119 boyeon0119 merged commit 4314df6 into develop Jan 13, 2024
@Zoe0929 Zoe0929 deleted the feat/#61-MyPageLogoutAndQuit branch June 12, 2024 07:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🌈 feat 기능 구현 🙊보연 보연의 issue
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[Feat] 마이페이지 로그아웃 및 회원탈퇴 알럿 연결
3 participants