generated from GO-SOPT-iOS-Part/KimSeungChan
-
Notifications
You must be signed in to change notification settings - Fork 1
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
Showing
8 changed files
with
309 additions
and
9 deletions.
There are no files selected for viewing
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,33 @@ | ||
// | ||
// Setting.swift | ||
// SOPTving | ||
// | ||
// Created by 장석우 on 2023/04/29. | ||
// | ||
|
||
import Foundation | ||
|
||
|
||
|
||
struct MyPageSetting { | ||
|
||
enum UserSetting: String, CaseIterable { | ||
case memberShip = "이용권" | ||
case inquiryDetails = "1:1 문의내역" | ||
case reservation = "예약알림" | ||
case changeUserInfo = "회원정보수정" | ||
case acceptMessages = "프로모션정보수신동의" | ||
} | ||
|
||
enum AppSetting: String, CaseIterable { | ||
case notice = "공지사항" | ||
case event = "이벤트" | ||
case serviceCenter = "고객센터" | ||
case more = "티빙 알아보기" | ||
} | ||
|
||
var userSetting = UserSetting.allCases.map { $0.rawValue } | ||
var appSetting = AppSetting.allCases.map { $0.rawValue } | ||
} | ||
|
||
|
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
85 changes: 85 additions & 0 deletions
85
SOPTving/SOPTving/Presentation/MainScene/View/MyPageSettingFooterView.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,85 @@ | ||
// | ||
// MyPageSettingFooterView.swift | ||
// SOPTving | ||
// | ||
// Created by 장석우 on 2023/04/29. | ||
// | ||
|
||
import UIKit | ||
|
||
final class MyPageSettingFooterView: UIView { | ||
|
||
//MARK: - Properties | ||
|
||
private let isLastSection: Bool | ||
|
||
//MARK: - UI Components | ||
|
||
private let seperatorView: UIView = { | ||
let view = UIView() | ||
view.backgroundColor = .tvingDarkGray | ||
return view | ||
}() | ||
|
||
private let logoutButton : UIButton = { | ||
let button = UIButton() | ||
button.setBorder(width: 1, color: .tvingDarkGray) | ||
button.makeCornerRound(ratio: 20) | ||
button.setTitle("로그아웃", for: .normal) | ||
button.setTitleColor(.tvingLightGray, for: .normal) | ||
button.titleLabel?.font = .tvingMedium(ofSize: 14) | ||
return button | ||
}() | ||
|
||
private lazy var vStackView: UIStackView = { | ||
let stackView = UIStackView(arrangedSubviews: [seperatorView,logoutButton]) | ||
stackView.axis = .vertical | ||
stackView.alignment = .center | ||
return stackView | ||
}() | ||
|
||
//MARK: - Life Cycle | ||
|
||
|
||
init(isLastSection: Bool) { | ||
self.isLastSection = isLastSection | ||
super.init(frame: .zero) | ||
|
||
style() | ||
hierarchy() | ||
layout() | ||
} | ||
|
||
required init?(coder: NSCoder) { | ||
fatalError("init(coder:) has not been implemented") | ||
} | ||
|
||
//MARK: - Custom Method | ||
|
||
private func style() { | ||
seperatorView.isHidden = isLastSection | ||
logoutButton.isHidden = !isLastSection | ||
} | ||
|
||
private func hierarchy() { | ||
self.addSubviews(vStackView) | ||
} | ||
|
||
private func layout() { | ||
|
||
vStackView.snp.makeConstraints { | ||
$0.top.bottom.equalToSuperview().inset(20) | ||
$0.leading.trailing.equalToSuperview() | ||
} | ||
|
||
seperatorView.snp.makeConstraints { | ||
$0.width.equalToSuperview().inset(10) | ||
$0.height.equalTo(1) | ||
} | ||
|
||
logoutButton.snp.makeConstraints { | ||
$0.width.equalToSuperview() | ||
$0.height.equalTo(54) | ||
} | ||
} | ||
} |
78 changes: 78 additions & 0 deletions
78
SOPTving/SOPTving/Presentation/MainScene/View/MyPageSettingTableViewCell.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,78 @@ | ||
// | ||
// MyPageSettingTableViewCell.swift | ||
// SOPTving | ||
// | ||
// Created by 장석우 on 2023/04/29. | ||
// | ||
|
||
import UIKit | ||
|
||
final class MyPageSettingTableViewCell: UITableViewCell { | ||
|
||
//MARK: - Properties | ||
|
||
|
||
//MARK: - UI Components | ||
|
||
private let titleLabel: UILabel = { | ||
let label = UILabel() | ||
label.textColor = .tvingLightGray | ||
label.font = .tvingMedium(ofSize: 16) | ||
return label | ||
}() | ||
|
||
private let rightImageView: UIImageView = { | ||
let view = UIImageView() | ||
view.image = UIImage(systemName: "chevron.right") | ||
view.contentMode = .scaleAspectFit | ||
view.tintColor = .tvingLightGray | ||
return view | ||
}() | ||
|
||
//MARK: - Life Cycle | ||
|
||
|
||
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { | ||
super.init(style: style, reuseIdentifier: reuseIdentifier) | ||
|
||
setUI() | ||
hierarchy() | ||
layout() | ||
|
||
} | ||
|
||
required init?(coder: NSCoder) { | ||
fatalError("init(coder:) has not been implemented") | ||
} | ||
|
||
//MARK: - Custom Method | ||
|
||
func dataBind(_ text: String) { | ||
titleLabel.text = text | ||
} | ||
} | ||
|
||
extension MyPageSettingTableViewCell { | ||
|
||
func setUI() { | ||
contentView.backgroundColor = .black | ||
} | ||
|
||
func hierarchy() { | ||
contentView.addSubviews(titleLabel, rightImageView) | ||
} | ||
|
||
func layout() { | ||
titleLabel.snp.makeConstraints { | ||
$0.centerY.equalToSuperview() | ||
$0.leading.equalToSuperview().offset(10) | ||
} | ||
|
||
rightImageView.snp.makeConstraints { | ||
$0.centerY.equalToSuperview() | ||
$0.trailing.equalToSuperview().offset(-5) | ||
$0.size.equalTo(20) | ||
} | ||
} | ||
|
||
} |
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
Oops, something went wrong.