Skip to content

Commit

Permalink
[iOS/#482]�마이페이지 완성 (#485)
Browse files Browse the repository at this point in the history
* feat: 버전 정보 detail label 추가

* feat: 개발자 정보 Safari로 연결

* feat: 개인정보 처리방침 및 개발자 정보 추가

* refactor: Bundle에서 버전 정보 가져오기
  • Loading branch information
nemanjabenkovic authored Jan 9, 2024
1 parent e462a15 commit fe8b64e
Show file tree
Hide file tree
Showing 10 changed files with 261 additions and 12 deletions.
4 changes: 4 additions & 0 deletions iOS/FlipMate/FlipMate.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@
EDC851C72B021492009031EA /* TabBarViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = EDC851C62B021492009031EA /* TabBarViewController.swift */; };
EDC851D22B04EE83009031EA /* CategoryListCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = EDC851D12B04EE83009031EA /* CategoryListCollectionViewCell.swift */; };
EDC851D92B05C37C009031EA /* DeviceMotionManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = EDC851D82B05C37C009031EA /* DeviceMotionManager.swift */; };
EDDAD39C2B4D2E43003A9D18 /* PrivacyPolicyViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = EDDAD39B2B4D2E43003A9D18 /* PrivacyPolicyViewController.swift */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -530,6 +531,7 @@
EDC851C62B021492009031EA /* TabBarViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TabBarViewController.swift; sourceTree = "<group>"; };
EDC851D12B04EE83009031EA /* CategoryListCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CategoryListCollectionViewCell.swift; sourceTree = "<group>"; };
EDC851D82B05C37C009031EA /* DeviceMotionManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = DeviceMotionManager.swift; path = FlipMate/Presentation/Utils/MotionManager/DeviceMotionManager.swift; sourceTree = SOURCE_ROOT; };
EDDAD39B2B4D2E43003A9D18 /* PrivacyPolicyViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PrivacyPolicyViewController.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -1484,6 +1486,7 @@
children = (
606990562B18918B00E5730F /* MyPageViewController.swift */,
60EB7F5A2B1F19D900F8C613 /* ProfileSettingsViewController.swift */,
EDDAD39B2B4D2E43003A9D18 /* PrivacyPolicyViewController.swift */,
);
path = ViewController;
sourceTree = "<group>";
Expand Down Expand Up @@ -1877,6 +1880,7 @@
2C2C7CBD2B29DFD900C733D5 /* DefaultPatchTimeZoneUseCase.swift in Sources */,
2C9F62222B173AB500AE63F9 /* FriendFollowReqeustDTO.swift in Sources */,
60EB7F5B2B1F19D900F8C613 /* ProfileSettingsViewController.swift in Sources */,
EDDAD39C2B4D2E43003A9D18 /* PrivacyPolicyViewController.swift in Sources */,
6087AED72B4A6F2B00B29637 /* DefaultDeleteCategoryUseCase.swift in Sources */,
ED38422C2B0F4531001E2803 /* LoginViewModel.swift in Sources */,
2CE91C702B25888C00EACCD7 /* UIViewController++Extension.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ final class MyPageDIContainer: MyPageFlowCoordinatorDependencies {
return ProfileSettingsViewController(viewModel: makeProfileSettingsViewModel(actions: actions))
}

func makePrivacyPolicyViewController() -> UIViewController {
return PrivacyPolicyViewController()
}

private func makeProfileSettingsViewModel(actions: ProfileSettingsViewModelActions) -> ProfileSettingsViewModel {
return ProfileSettingsViewModel(
validateNicknameUseCase: DefaultValidateNicknameUseCase(validator: NickNameValidator()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ protocol MyPageFlowCoordinatorDependencies {
func makeMyPageFlowCoordinator(navigationController: UINavigationController?) -> MyPageFlowCoordinator
func makeMyPageViewController(actions: MyPageViewModelActions) -> UIViewController
func makeProfileSettingsViewController(actions: ProfileSettingsViewModelActions) -> UIViewController
func makePrivacyPolicyViewController() -> UIViewController
}

final class MyPageFlowCoordinator: Coordinator {
Expand All @@ -27,7 +28,7 @@ final class MyPageFlowCoordinator: Coordinator {

func start() {
let actions = MyPageViewModelActions(
showProfileSettingsView: showProfileSettingsView,
showProfileSettingsView: showProfileSettingsView, showPrivacyPolicyView: showPrivacyPolicyView,
viewDidFinish: dismissView
)
let myPageViewControlelr = dependencies.makeMyPageViewController(actions: actions)
Expand All @@ -53,6 +54,11 @@ final class MyPageFlowCoordinator: Coordinator {
myPageNavigationController.pushViewController(profileSettingsViewControlelr, animated: true)
}

private func showPrivacyPolicyView() {
let privacyPolicyViewController = dependencies.makePrivacyPolicyViewController()
myPageNavigationController.pushViewController(privacyPolicyViewController, animated: true)
}

private func didFinishSignUp() {
myPageNavigationController.popViewController(animated: true)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ final class MyPageTableViewCell: UITableViewCell {
return label
}()

private let detail: UILabel = {
let label = UILabel()
label.font = FlipMateFont.mediumRegular.font
label.textColor = FlipMateColor.gray2.color

return label
}()

override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
configureUI()
Expand All @@ -29,7 +37,7 @@ final class MyPageTableViewCell: UITableViewCell {

private func configureUI() {
let subviews = [
title
title, detail
]

subviews.forEach {
Expand All @@ -40,12 +48,18 @@ final class MyPageTableViewCell: UITableViewCell {
NSLayoutConstraint.activate([
title.topAnchor.constraint(equalTo: self.topAnchor, constant: 8),
title.leadingAnchor.constraint(equalTo: self.leadingAnchor, constant: 16),
title.trailingAnchor.constraint(equalTo: self.trailingAnchor, constant: -16),
title.bottomAnchor.constraint(equalTo: self.bottomAnchor, constant: -8)
])

NSLayoutConstraint.activate([
detail.topAnchor.constraint(equalTo: title.topAnchor),
detail.trailingAnchor.constraint(equalTo: self.trailingAnchor, constant: -16),
detail.bottomAnchor.constraint(equalTo: title.bottomAnchor)
])
}

func configureCell(title: String) {
func configureCell(title: String, detail: String?) {
self.title.text = title
self.detail.text = detail
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import UIKit
import Combine
import SafariServices

final class MyPageViewController: BaseViewController {
// MARK: - View Properties
Expand Down Expand Up @@ -134,7 +135,7 @@ extension MyPageViewController: UITableViewDataSource {
case 0:
return 1
case 1:
return 2
return 3
case 2:
return 1
case 3:
Expand All @@ -148,7 +149,13 @@ extension MyPageViewController: UITableViewDataSource {
guard let cell = tableView.dequeueReusableCell(withIdentifier: MyPageTableViewCell.identifier, for: indexPath) as? MyPageTableViewCell else {
return MyPageTableViewCell()
}
cell.configureCell(title: myPageDataSource[indexPath.section][indexPath.row])

if indexPath.section == 1 && indexPath.row == 1 {
guard let dictionary = Bundle.main.infoDictionary, let version = dictionary["CFBundleShortVersionString"] as? String else { return cell }
cell.configureCell(title: myPageDataSource[indexPath.section][indexPath.row], detail: "v\(version)")
} else {
cell.configureCell(title: myPageDataSource[indexPath.section][indexPath.row], detail: nil)
}
return cell
}

Expand Down Expand Up @@ -182,12 +189,15 @@ extension MyPageViewController: UITableViewDelegate {
if indexPath.section == 1 {
// 개발자 정보 탭
if indexPath.row == 0 {

let infoUrl = NSURL(string: "https://yeim.notion.site/729517f5f8754f53b555a6b457746d9e?pvs=4")
// swiftlint:disable force_unwrapping
let infoSafariView = SFSafariViewController(url: infoUrl! as URL)
self.present(infoSafariView, animated: true, completion: nil)
// swiftlint:enable force_unwrapping
}

// 버전 정보 탭
if indexPath.row == 1 {

if indexPath.row == 2 {
viewModel.privacyPolicyViewButtonTapped()
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
//
// PrivatePolicyViewController.swift
// FlipMate
//
// Created by 신민규 on 1/9/24.
//

import UIKit

class PrivacyPolicyViewController: BaseViewController {
enum Constant {
static let privatePolicyLabel = NSLocalizedString("privacyPolicyLabel", comment: "")
static let privacyPolicy = NSLocalizedString("privacyPolicy", comment: "")
}
// MARK: - View Properties
private let scrollview: UIScrollView = {
let scrollView = UIScrollView()
scrollView.isScrollEnabled = true
scrollView.indicatorStyle = .default
scrollView.showsVerticalScrollIndicator = true
scrollView.translatesAutoresizingMaskIntoConstraints = false

return scrollView
}()

private let contentLabel: UILabel = {
let label = UILabel()
label.numberOfLines = 0
label.font = FlipMateFont.smallRegular.font
label.textColor = .label
label.text = Constant.privatePolicyLabel
label.translatesAutoresizingMaskIntoConstraints = false

return label
}()

override func configureUI() {
self.navigationItem.title = Constant.privacyPolicy

self.view.addSubview(scrollview)
scrollview.addSubview(contentLabel)

NSLayoutConstraint.activate([
scrollview.topAnchor.constraint(equalTo: self.view.topAnchor, constant: 40),
scrollview.leadingAnchor.constraint(equalTo: self.view.leadingAnchor, constant: 10),
scrollview.trailingAnchor.constraint(equalTo: self.view.trailingAnchor, constant: -10),
scrollview.bottomAnchor.constraint(equalTo: self.view.bottomAnchor, constant: -40)
])

NSLayoutConstraint.activate([
contentLabel.topAnchor.constraint(equalTo: scrollview.topAnchor, constant: 10),
contentLabel.leadingAnchor.constraint(equalTo: scrollview.leadingAnchor),
contentLabel.trailingAnchor.constraint(equalTo: scrollview.trailingAnchor),
contentLabel.bottomAnchor.constraint(equalTo: scrollview.bottomAnchor, constant: -10),
contentLabel.widthAnchor.constraint(equalTo: scrollview.widthAnchor)
])
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@ import Combine

struct MyPageViewModelActions {
let showProfileSettingsView: () -> Void
let showPrivacyPolicyView: () -> Void
let viewDidFinish: () -> Void
}

protocol MyPageViewModelInput {
func viewReady()
func profileSettingsViewButtonTapped()
func privacyPolicyViewButtonTapped()
func dismissButtonDidTapped()
func signOutButtonTapped()
func withdrawButtonTapped()
Expand All @@ -33,7 +35,7 @@ typealias MyPageViewModelProtocol = MyPageViewModelInput & MyPageViewModelOutput
final class MyPageViewModel: MyPageViewModelProtocol {
private let myPageDataSource: [[String]] = [
[Constant.editProfile],
[Constant.developer, Constant.version],
[Constant.developer, Constant.version, Constant.privacyPolicy],
[Constant.signout],
[Constant.withdrawal]
]
Expand Down Expand Up @@ -68,6 +70,10 @@ final class MyPageViewModel: MyPageViewModelProtocol {
actions?.showProfileSettingsView()
}

func privacyPolicyViewButtonTapped() {
actions?.showPrivacyPolicyView()
}

func signOutButtonTapped() {
signOutUseCsae.signOut()
}
Expand Down Expand Up @@ -105,6 +111,7 @@ private extension MyPageViewModel {
static let editProfile = NSLocalizedString("editProfile", comment: "")
static let version = NSLocalizedString("version", comment: "")
static let developer = NSLocalizedString("developer", comment: "")
static let privacyPolicy = NSLocalizedString("privacyPolicy", comment: "")
static let signout = NSLocalizedString("signout", comment: "")
static let withdrawal = NSLocalizedString("withdrawal", comment: "")
}
Expand Down
48 changes: 48 additions & 0 deletions iOS/FlipMate/FlipMate/Resources/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"contact" = "Contact";
"developer" = "Developer Info";
"version" = "Version Info";
"privacyPolicy" = "Privacy Policy";
"reset" = "Reset Data";
"signout" = "Log Out";
"signoutMessage" = "Do you want to log out?";
Expand All @@ -50,7 +51,54 @@
"emptyViolation" = "Nickname must contain at least 2 characters.";
"duplicated" = "Nickname has been duplicated.";
"emojiContained" = "Nickname cannot contain emojis.";
"privacyPolicyLabel" = "
'Flipmate' adheres to the Personal Information Protection Act to protect the privacy and rights of users, and we have established the following privacy policy:

In the event of any amendments to our privacy policy, we will provide notice through the announcement section of the app.

1. Purpose of Processing Personal Information:
We do not store or use personal information separately.

2. Status of Personal Information Files:
We do not use or store separate personal information files.
We do not use cookies.
Users with concerns regarding this should directly contact the respective service (application).

3. Processing and Retention Period of Personal Information:
We do not directly store or retain personal information.
We do not have any content or retention period for processing user's personal information.

4. Matters Regarding the Provision of Personal Information to Third Parties:
We do not provide personal information to third parties.

5. Outsourcing of Personal Information Processing:
We do not outsource the processing of personal information.

6. Rights, Obligations, and Methods of Exercising Rights of Data Subjects:
Users can exercise their rights as data subjects.

1) Request for access to personal information
2) Request for correction in case of errors
3) Request for deletion
4) Request for suspension of processing
We do not store personal information.

7. Destruction of Personal Information:
Our application operates independently without using a separate server.
Also, as we do not store personal information, there is no personal information to be destroyed.
However, users can delete all data by uninstalling the application if they wish.

8. Guidance on the Use of Third-Party Modules:
We are not currently using third-party service modules.
If we use them in the future, we plan to update the app's privacy policy.

9. Personal Information Protection Manager:
If you have any questions or concerns about this privacy policy, or if you have questions about the personal information processing procedure, please contact us at:

- Email: [email protected]


";

// MARK: - Friend Add Scene
"addFriend" = "Add Friend";
Expand Down
Loading

0 comments on commit fe8b64e

Please sign in to comment.