-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b81b1be
commit f56cb7a
Showing
8 changed files
with
192 additions
and
56 deletions.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
iOS-NOTTODO/iOS-NOTTODO/Presentation/Home/ViewControllers/MyPageViewController.swift
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// | ||
// MyPageViewController.swift | ||
// iOS-NOTTODO | ||
// | ||
// Created by JEONGEUN KIM on 3/15/24. | ||
// | ||
|
||
import Foundation |
This file contains 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
This file contains 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
This file contains 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
53 changes: 53 additions & 0 deletions
53
iOS-NOTTODO/iOS-NOTTODO/Presentation/MyPage/Model/MyPageModel.swift
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
// | ||
// MyPageModel.swift | ||
// iOS-NOTTODO | ||
// | ||
// Created by JEONGEUN KIM on 3/15/24. | ||
// | ||
|
||
import UIKit | ||
|
||
struct MyPageModel: Hashable { | ||
let sections: [Section] | ||
|
||
enum Section: CaseIterable { | ||
case profile, support, info, version | ||
|
||
var rows: [MyPageRowData] { | ||
switch self { | ||
case .profile: | ||
return MyPageRowData.profile | ||
case .support: | ||
return MyPageRowData.support | ||
case .info: | ||
return MyPageRowData.info | ||
case .version: | ||
return MyPageRowData.version() | ||
} | ||
} | ||
} | ||
} | ||
|
||
struct MyPageRowData: Hashable { | ||
|
||
var image: UIImage? | ||
var user: String? | ||
var email: String? | ||
var title: String? | ||
|
||
static var profile: [MyPageRowData] = [MyPageRowData(image: .imgUser, | ||
user: UserDefaults.standard.bool(forKey: DefaultKeys.isAppleLogin) ? KeychainUtil.getAppleUsername() : KeychainUtil.getKakaoNickname(), | ||
email: UserDefaults.standard.bool(forKey: DefaultKeys.isAppleLogin) ? KeychainUtil.getAppleEmail() : KeychainUtil.getKakaoEmail())] | ||
|
||
static let support: [MyPageRowData] = [MyPageRowData(image: .icGuide, title: I18N.guide), | ||
MyPageRowData(image: .icQuestion1, title: I18N.oftenQuestion) | ||
] | ||
|
||
static let info: [MyPageRowData] = [MyPageRowData(title: I18N.notice), | ||
MyPageRowData(title: I18N.sendFeedback), | ||
MyPageRowData(title: I18N.inquiry), | ||
MyPageRowData(title: I18N.policies) | ||
] | ||
|
||
static func version() -> [MyPageRowData] { return [MyPageRowData(title: I18N.version + " " + (Utils.version ?? "1.0.0"))] } | ||
} |
This file contains 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
22 changes: 22 additions & 0 deletions
22
iOS-NOTTODO/iOS-NOTTODO/Presentation/MyPage/ViewModel/MyPageViewModel.swift
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// | ||
// MyPageViewModel.swift | ||
// iOS-NOTTODO | ||
// | ||
// Created by JEONGEUN KIM on 3/15/24. | ||
// | ||
|
||
import Foundation | ||
import Combine | ||
|
||
protocol MyPageViewModellPresentable {} | ||
|
||
protocol MyPageViewModel: ViewModel where Input == MyPageViewModelInput, Output == MyPageViewModelOutput {} | ||
|
||
struct MyPageViewModelInput { | ||
let viewWillAppearSubject: PassthroughSubject<Void, Never> | ||
let profileCellTapped: PassthroughSubject<Void, Never> | ||
} | ||
|
||
struct MyPageViewModelOutput { | ||
let viewWillAppearSubject: AnyPublisher<MyPageModel, Never> | ||
} |
Oops, something went wrong.