Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 8 additions & 10 deletions Runnect-iOS/Runnect-iOS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +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 */; };
A3C2CADB29E9A12400EC525B /* DeleteAccountVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3C2CADA29E9A12400EC525B /* DeleteAccountVC.swift */; };
A3C2CAD729E53B2900EC525B /* RNAlertVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3C2CAD629E53B2900EC525B /* RNAlertVC.swift */; };
A3D1A77929CF03D200DD54EC /* AuthRouter.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3D1A77829CF03D200DD54EC /* AuthRouter.swift */; };
A3D1A77E29CF09B600DD54EC /* SignInResponseDto.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3D1A77D29CF09B600DD54EC /* SignInResponseDto.swift */; };
A3D1A78029CF142E00DD54EC /* UserManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3D1A77F29CF142E00DD54EC /* UserManager.swift */; };
Expand Down Expand Up @@ -145,6 +144,7 @@
CEEC6B492961C5E200D00E1E /* SplashVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEEC6B482961C5E200D00E1E /* SplashVC.swift */; };
CEEC6B4B2961D89700D00E1E /* CustomNavigationBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEEC6B4A2961D89700D00E1E /* CustomNavigationBar.swift */; };
CEF3CD9A296DB305002723A1 /* CourseDetailResponseDto.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEF3CD99296DB305002723A1 /* CourseDetailResponseDto.swift */; };
CEFA9A2F29FC263700F2D0CF /* UserDeleteResponseDto.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEFA9A2E29FC263700F2D0CF /* UserDeleteResponseDto.swift */; };
DA20D847296697A600F1581F /* MyCourseSelectVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA20D846296697A600F1581F /* MyCourseSelectVC.swift */; };
DA20D849296697B400F1581F /* CourseUploadVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA20D848296697B400F1581F /* CourseUploadVC.swift */; };
DA20D84E2966A9B300F1581F /* CourseSearchVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA20D84D2966A9B300F1581F /* CourseSearchVC.swift */; };
Expand All @@ -171,8 +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>"; };
A3C2CADA29E9A12400EC525B /* DeleteAccountVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeleteAccountVC.swift; sourceTree = "<group>"; };
A3C2CAD629E53B2900EC525B /* RNAlertVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RNAlertVC.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>"; };
A3D1A77F29CF142E00DD54EC /* UserManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserManager.swift; sourceTree = "<group>"; };
Expand All @@ -186,7 +185,6 @@
CE0C23782966D6AF00B45063 /* ViewPager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewPager.swift; sourceTree = "<group>"; };
CE0D9FD229648DA300CEB5CD /* CustomAlertVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomAlertVC.swift; sourceTree = "<group>"; };
CE10063929680C5700FD31FB /* .gitkeep */ = {isa = PBXFileReference; lastKnownFileType = text; path = .gitkeep; sourceTree = "<group>"; };
CE10063D29680C8100FD31FB /* .gitkeep */ = {isa = PBXFileReference; lastKnownFileType = text; path = .gitkeep; sourceTree = "<group>"; };
CE10064D29680D2500FD31FB /* .gitkeep */ = {isa = PBXFileReference; lastKnownFileType = text; path = .gitkeep; sourceTree = "<group>"; };
CE10064F29680D3300FD31FB /* .gitkeep */ = {isa = PBXFileReference; lastKnownFileType = text; path = .gitkeep; sourceTree = "<group>"; };
CE10065029680D3800FD31FB /* .gitkeep */ = {isa = PBXFileReference; lastKnownFileType = text; path = .gitkeep; sourceTree = "<group>"; };
Expand Down Expand Up @@ -308,6 +306,7 @@
CEEC6B482961C5E200D00E1E /* SplashVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SplashVC.swift; sourceTree = "<group>"; };
CEEC6B4A2961D89700D00E1E /* CustomNavigationBar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomNavigationBar.swift; sourceTree = "<group>"; };
CEF3CD99296DB305002723A1 /* CourseDetailResponseDto.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CourseDetailResponseDto.swift; sourceTree = "<group>"; };
CEFA9A2E29FC263700F2D0CF /* UserDeleteResponseDto.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserDeleteResponseDto.swift; sourceTree = "<group>"; };
DA20D846296697A600F1581F /* MyCourseSelectVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyCourseSelectVC.swift; sourceTree = "<group>"; };
DA20D848296697B400F1581F /* CourseUploadVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CourseUploadVC.swift; sourceTree = "<group>"; };
DA20D84D2966A9B300F1581F /* CourseSearchVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CourseSearchVC.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -391,8 +390,6 @@
A3C2CACD29E313CC00EC525B /* SettingVC.swift */,
A3C2CAD229E4F77C00EC525B /* TermsOfServiceVC.swift */,
A3C2CAD429E4F85400EC525B /* PersonalInfoVC.swift */,
A3C2CAD629E53B2900EC525B /* LogoutVC.swift */,
A3C2CADA29E9A12400EC525B /* DeleteAccountVC.swift */,
);
path = SettingVC;
sourceTree = "<group>";
Expand Down Expand Up @@ -452,10 +449,10 @@
CE10063429680C0800FD31FB /* MyPageDto */ = {
isa = PBXGroup;
children = (
CE10063D29680C8100FD31FB /* .gitkeep */,
A3F67AE1296D33AC001598A2 /* MyPageDto.swift */,
A3F67AE9296E4936001598A2 /* ActivityRecordInfoDto.swift */,
A3305A96296EF58C000B1A10 /* GoalRewardInfoDto.swift */,
CEFA9A2E29FC263700F2D0CF /* UserDeleteResponseDto.swift */,
);
path = MyPageDto;
sourceTree = "<group>";
Expand Down Expand Up @@ -1032,6 +1029,7 @@
CE9291262965D0ED0010959C /* StatsInfoView.swift */,
CE6B63D729673450003F900F /* ListEmptyView.swift */,
CEB0BCBB29D123350048CCD5 /* GuideView.swift */,
A3C2CAD629E53B2900EC525B /* RNAlertVC.swift */,
);
path = UIComponents;
sourceTree = "<group>";
Expand Down Expand Up @@ -1361,7 +1359,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 All @@ -1375,6 +1373,7 @@
DAD5A3D8296C6D9600C8166B /* AdImageCollectionViewCell.swift in Sources */,
CE18E890296C76C100FEB569 /* RNLocationModel.swift in Sources */,
CE6655DC295D873500C64E12 /* UIButton+.swift in Sources */,
CEFA9A2F29FC263700F2D0CF /* UserDeleteResponseDto.swift in Sources */,
CE21C02C299E601000F62AF5 /* ScrapRouter.swift in Sources */,
A3D1A78029CF142E00DD54EC /* UserManager.swift in Sources */,
A3D1A77929CF03D200DD54EC /* AuthRouter.swift in Sources */,
Expand All @@ -1392,7 +1391,6 @@
CEEC6B3A2961C4F300D00E1E /* CourseDrawingHomeVC.swift in Sources */,
CEB0BCBC29D123350048CCD5 /* GuideView.swift in Sources */,
CEC2A6902962B06C00160BF7 /* convertLocationObject.swift in Sources */,
A3C2CADB29E9A12400EC525B /* DeleteAccountVC.swift in Sources */,
CEC2A6852961F92C00160BF7 /* CustomButton.swift in Sources */,
CE6B63D3296725E6003F900F /* CourseListCVC.swift in Sources */,
CEF3CD9A296DB305002723A1 /* CourseDetailResponseDto.swift in Sources */,
Expand Down
3 changes: 2 additions & 1 deletion Runnect-iOS/Runnect-iOS/Global/Literal/ImageLiterals.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ enum ImageLiterals {
static var icMapStart: UIImage { .load(named: "ic_map_start") }
static var icMypageFill: UIImage { .load(named: "ic_mypage_fill") }
static var icMypage: UIImage { .load(named: "ic_mypage") }
static var icPlus: UIImage { .load(named: "ic_plus") }
static var icPlusButton: UIImage { .load(named: "ic_plus_button") }
static var icSearch: UIImage { .load(named: "ic_search") }
static var icStar: UIImage { .load(named: "ic_star") }
static var icStar2: UIImage { .load(named: "ic_star2") }
Expand All @@ -43,6 +43,7 @@ enum ImageLiterals {
static var icLocationOverlay: UIImage { .load(named: "ic_location_overlay") }
static var icLogoCircle: UIImage { .load(named: "ic_logo_circle") }
static var icMore: UIImage { .load(named: "ic_more") }
static var icPlus: UIImage { .load(named: "ic_plus") }

// img
static var imgBackground: UIImage { .load(named: "img_background") }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,23 @@
{
"images" : [
{
"filename" : "plus.png",
"filename" : "Group 9553.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "plus@2x.png",
"filename" : "Group 9553@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "plus@3x.png",
"filename" : "Group 9553@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"template-rendering-intent" : "original"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"images" : [
{
"filename" : "plus.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "plus@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "plus@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"template-rendering-intent" : "original"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +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 {
$0.text = "로그아웃 하시겠어요?"
private let descriptionLabel = UILabel().then {
$0.font = .b4
$0.textColor = .g2
}
Expand All @@ -42,6 +43,15 @@ final class LogoutVC: UIViewController {
$0.layer.cornerRadius = 10
}

init(description: String) {
super.init(nibName: nil, bundle: nil)
self.descriptionLabel.text = description
}

required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}

// MARK: - View Life Cycle

override func viewDidLoad() {
Expand All @@ -54,7 +64,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 +74,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 +108,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
10 changes: 10 additions & 0 deletions Runnect-iOS/Runnect-iOS/Global/Utils/RNUtils/UserManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,14 @@ final class UserManager {
}
}
}

func logout() {
self.resetTokens()
}

private func resetTokens() {
self.accessToken = nil
self.refreshToken = nil
self.isKakao = nil
}
}
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
//
// UserDeleteResponseDto.swift
// Runnect-iOS
//
// Created by sejin on 2023/04/29.
//

import Foundation

struct UserDeleteResponseDto: Codable {
let deletedUserId: Int
}
18 changes: 15 additions & 3 deletions Runnect-iOS/Runnect-iOS/Network/Router/UserRouter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import Moya
enum UserRouter {
case getMyPageInfo
case updateUserNickname(nickname: String)
case deleteUser(appleToken: String?)
}

extension UserRouter: TargetType {
Expand All @@ -25,7 +26,7 @@ extension UserRouter: TargetType {

var path: String {
switch self {
case .getMyPageInfo, .updateUserNickname:
case .getMyPageInfo, .updateUserNickname, .deleteUser:
return "/user"
}
}
Expand All @@ -36,20 +37,31 @@ extension UserRouter: TargetType {
return .get
case .updateUserNickname:
return .patch
case .deleteUser:
return .delete
}
}

var task: Moya.Task {
switch self {
case .getMyPageInfo:
case .getMyPageInfo, .deleteUser:
return .requestPlain
case .updateUserNickname(let nickname):
return .requestParameters(parameters: ["nickname": nickname], encoding: JSONEncoding.default)
}
}

var headers: [String: String]? {
return Config.defaultHeader
switch self {
case .deleteUser(let appleToken):
if let appleToken = appleToken {
return ["Content-Type": "application/json", "appleAccessToken": appleToken]
} else {
return Config.defaultHeader
}
default:
return Config.defaultHeader
}
}

var validationType: ValidationType {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ final class AuthInterceptor: RequestInterceptor {

func retry(_ request: Request, for session: Session, dueTo error: Error, completion: @escaping (RetryResult) -> Void) {
print("retry 진입")
guard let response = request.task?.response as? HTTPURLResponse, response.statusCode == 401
guard let response = request.task?.response as? HTTPURLResponse, response.statusCode == 401, let pathComponents = request.request?.url?.pathComponents,
!pathComponents.contains("getNewToken")
else {
completion(.doNotRetryWithError(error))
return
Expand Down
Loading