Skip to content

Commit

Permalink
[Feat] Runnect#129 - LogoutVC를 RNAlertVC로 변경 및 우측 버튼 액션 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
lsj8706 committed Apr 28, 2023
1 parent 86a50a7 commit c76d2a8
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 13 deletions.
8 changes: 4 additions & 4 deletions Runnect-iOS/Runnect-iOS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
A3C2CACE29E313CC00EC525B /* SettingVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3C2CACD29E313CC00EC525B /* SettingVC.swift */; };
A3C2CAD329E4F77C00EC525B /* TermsOfServiceVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3C2CAD229E4F77C00EC525B /* TermsOfServiceVC.swift */; };
A3C2CAD529E4F85400EC525B /* PersonalInfoVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3C2CAD429E4F85400EC525B /* PersonalInfoVC.swift */; };
A3C2CAD729E53B2900EC525B /* LogoutVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3C2CAD629E53B2900EC525B /* LogoutVC.swift */; };
A3C2CAD729E53B2900EC525B /* RNAlertVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3C2CAD629E53B2900EC525B /* RNAlertVC.swift */; };
A3C2CADB29E9A12400EC525B /* DeleteAccountVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3C2CADA29E9A12400EC525B /* DeleteAccountVC.swift */; };
A3D1A77929CF03D200DD54EC /* AuthRouter.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3D1A77829CF03D200DD54EC /* AuthRouter.swift */; };
A3D1A77E29CF09B600DD54EC /* SignInResponseDto.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3D1A77D29CF09B600DD54EC /* SignInResponseDto.swift */; };
Expand Down Expand Up @@ -171,7 +171,7 @@
A3C2CACD29E313CC00EC525B /* SettingVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingVC.swift; sourceTree = "<group>"; };
A3C2CAD229E4F77C00EC525B /* TermsOfServiceVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TermsOfServiceVC.swift; sourceTree = "<group>"; };
A3C2CAD429E4F85400EC525B /* PersonalInfoVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PersonalInfoVC.swift; sourceTree = "<group>"; };
A3C2CAD629E53B2900EC525B /* LogoutVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LogoutVC.swift; sourceTree = "<group>"; };
A3C2CAD629E53B2900EC525B /* RNAlertVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RNAlertVC.swift; sourceTree = "<group>"; };
A3C2CADA29E9A12400EC525B /* DeleteAccountVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeleteAccountVC.swift; sourceTree = "<group>"; };
A3D1A77829CF03D200DD54EC /* AuthRouter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AuthRouter.swift; sourceTree = "<group>"; };
A3D1A77D29CF09B600DD54EC /* SignInResponseDto.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SignInResponseDto.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -391,7 +391,6 @@
A3C2CACD29E313CC00EC525B /* SettingVC.swift */,
A3C2CAD229E4F77C00EC525B /* TermsOfServiceVC.swift */,
A3C2CAD429E4F85400EC525B /* PersonalInfoVC.swift */,
A3C2CAD629E53B2900EC525B /* LogoutVC.swift */,
A3C2CADA29E9A12400EC525B /* DeleteAccountVC.swift */,
);
path = SettingVC;
Expand Down Expand Up @@ -1032,6 +1031,7 @@
CE9291262965D0ED0010959C /* StatsInfoView.swift */,
CE6B63D729673450003F900F /* ListEmptyView.swift */,
CEB0BCBB29D123350048CCD5 /* GuideView.swift */,
A3C2CAD629E53B2900EC525B /* RNAlertVC.swift */,
);
path = UIComponents;
sourceTree = "<group>";
Expand Down Expand Up @@ -1361,7 +1361,7 @@
CE40BB1C2967E4910030ABCA /* RunningWaitingVC.swift in Sources */,
CE6B63D6296731F9003F900F /* ScrapCourseListView.swift in Sources */,
CE6655F8295D90CF00C64E12 /* adjusted+.swift in Sources */,
A3C2CAD729E53B2900EC525B /* LogoutVC.swift in Sources */,
A3C2CAD729E53B2900EC525B /* RNAlertVC.swift in Sources */,
DAD5A3E2296D4C6500C8166B /* PickedMapListResponseDto.swift in Sources */,
CE4545CB295D7AF4003201E1 /* SceneDelegate.swift in Sources */,
A3F67AE2296D33AC001598A2 /* MyPageDto.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,19 @@ import UIKit
import SnapKit
import Then

final class LogoutVC: UIViewController {
final class RNAlertVC: UIViewController {

// MARK: - Properties

var rightButtonTapAction: (() -> Void)?

// MARK: - UI Components

private let containerView = UIView().then {
$0.layer.cornerRadius = 15
}

private let logoutQuestionLabel = UILabel().then {
private let DescriptionLabel = UILabel().then {
$0.text = "로그아웃 하시겠어요?"
$0.font = .b4
$0.textColor = .g2
Expand Down Expand Up @@ -54,7 +56,7 @@ final class LogoutVC: UIViewController {

// MARK: - Methods

extension LogoutVC {
extension RNAlertVC {
override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
super.touchesBegan(touches, with: event)
if let touch = touches.first, touch.view == self.view {
Expand All @@ -64,20 +66,25 @@ extension LogoutVC {

private func setAddTarget() {
self.noButton.addTarget(self, action: #selector(touchUpNoButton), for: .touchUpInside)
self.yesButton.addTarget(self, action: #selector(touchYesButton), for: .touchUpInside)
}
}

// MARK: - @objc Function

extension LogoutVC {
@objc func touchUpNoButton() {
extension RNAlertVC {
@objc private func touchUpNoButton() {
dismiss(animated: false)
}

@objc private func touchYesButton() {
self.rightButtonTapAction?()
}
}

// MARK: - Layout Helpers

extension LogoutVC {
extension RNAlertVC {
private func setUI() {
view.backgroundColor = .black.withAlphaComponent(0.8)
containerView.backgroundColor = .w1
Expand All @@ -93,9 +100,9 @@ extension LogoutVC {
make.height.equalTo(126)
}

containerView.addSubviews(logoutQuestionLabel, yesButton, noButton)
containerView.addSubviews(DescriptionLabel, yesButton, noButton)

logoutQuestionLabel.snp.makeConstraints { make in
DescriptionLabel.snp.makeConstraints { make in
make.centerX.equalToSuperview()
make.top.equalToSuperview().offset(26)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,10 @@ extension PersonalInfoVC {
}

private func pushToLogoutVC() {
let logoutVC = LogoutVC()
let logoutVC = RNAlertVC()
logoutVC.rightButtonTapAction = {
print("로그아웃 버튼 클릭!~~!")
}
logoutVC.modalPresentationStyle = .overFullScreen
self.present(logoutVC, animated: false)
}
Expand Down

0 comments on commit c76d2a8

Please sign in to comment.