-
Notifications
You must be signed in to change notification settings - Fork 0
[feat] terms agreement #198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,16 @@ | ||
| // | ||
| // TermsAPI.swift | ||
| // Data | ||
| // | ||
| // Created by 김호성 on 2026.05.29. | ||
| // | ||
|
|
||
| import Foundation | ||
|
|
||
| import Moya | ||
|
|
||
| public enum TermsAPI { | ||
| case getTerms | ||
| case getTerm(id: String) | ||
| case agreeTerms(ids: [String]) | ||
| } |
This file contains hidden or 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,68 @@ | ||
| // | ||
| // SignUpTerm.swift | ||
| // Domain | ||
| // | ||
| // Created by 김호성 on 2026.06.10. | ||
| // | ||
|
|
||
| import Foundation | ||
|
|
||
| public enum SignUpTerm: String, Sendable, CaseIterable { | ||
| case service = "SERVICE" | ||
| case privacy = "PRIVACY" | ||
| } | ||
|
|
||
| extension SignUpTerm { | ||
| public init?(id: Int) { | ||
| switch id { | ||
| case 1: | ||
| self = .service | ||
| case 2: | ||
| self = .privacy | ||
| default: | ||
| return nil | ||
| } | ||
| } | ||
|
|
||
| public var id: Int { | ||
| switch self { | ||
| case .service: | ||
| return 1 | ||
| case .privacy: | ||
| return 2 | ||
| } | ||
| } | ||
|
|
||
| public var title: String { | ||
| switch self { | ||
| case .service: | ||
| return "서비스 이용 약관 동의" | ||
| case .privacy: | ||
| return "개인정보 처리 방침 동의" | ||
| } | ||
| } | ||
|
|
||
| public var description: String { | ||
| switch self { | ||
| case .service: | ||
| return """ | ||
| 본 약관은 서비스 이용과 관련한 기본적인 권리·의무 및 책임사항을 규정합니다. | ||
| """ | ||
| case .privacy: | ||
| return """ | ||
| 서비스 제공을 위해 개인정보를 수집 · 이용합니다. 콘텐츠 추천, 컬렉션 생성 및 공유, 맞춤형 탐색 경험 제공을 위한 이용 기록 및 취향 정보 처리 내용이 포함됩니다. | ||
|
|
||
| 수집 항목 : 계정 정보, 취향 정보, 컬렉션 및 콘텐츠 활동, 서비스 이용 기록 등 | ||
|
|
||
| 수집 목적: 개인화 추천 제공, 컬렉션 생성 및 공유, 서비스 운영 및 이용자 보호 | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| public var isRequired: Bool { | ||
| switch self { | ||
| case .service, .privacy: | ||
| return true | ||
| } | ||
| } | ||
| } |
This file contains hidden or 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
16 changes: 16 additions & 0 deletions
16
FLINT/FLINT/Dependency/Factory/ViewController/TermsAgreementViewControllerFactory+.swift
This file contains hidden or 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,16 @@ | ||
| // | ||
| // TermsAgreementViewControllerFactory+.swift | ||
| // FLINT | ||
| // | ||
| // Created by 김호성 on 2026.05.29. | ||
| // | ||
|
|
||
| import Foundation | ||
|
|
||
| import Presentation | ||
|
|
||
| extension TermsAgreementViewControllerFactory where Self: OnboardingViewModelFactory & ViewControllerFactory { | ||
| func makeTermsAgreementViewController() -> TermsAgreementViewController { | ||
| return TermsAgreementViewController(onboardingViewModel: makeOnboardingViewModel(), viewControllerFactory: self) | ||
| } | ||
| } |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
38 changes: 38 additions & 0 deletions
38
FLINT/Presentation/Sources/View/Base/BaseCollectionViewListCell.swift
This file contains hidden or 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,38 @@ | ||
| // | ||
| // BaseCollectionViewListCell.swift | ||
| // Presentation | ||
| // | ||
| // Created by 김호성 on 2026.06.01. | ||
| // | ||
|
|
||
| import UIKit | ||
|
|
||
| public class BaseCollectionViewListCell: UICollectionViewListCell, ReuseIdentifiable { | ||
|
|
||
| // MARK: - Init | ||
|
|
||
| public override init(frame: CGRect) { | ||
| super.init(frame: frame) | ||
| setStyle() | ||
| setHierarchy() | ||
| setLayout() | ||
| } | ||
|
|
||
| required init?(coder: NSCoder) { | ||
| fatalError("init(coder:) has not been implemented") | ||
| } | ||
|
|
||
| // MARK: - Lifecycle | ||
|
|
||
| public override func prepareForReuse() { | ||
| super.prepareForReuse() | ||
| prepare() | ||
| } | ||
|
|
||
| // MARK: - Override Points | ||
|
|
||
| public func setStyle() { } | ||
| public func setHierarchy() { } | ||
| public func setLayout() { } | ||
| public func prepare() { } | ||
| } |
22 changes: 22 additions & 0 deletions
22
FLINT/Presentation/Sources/View/Component/FlintCheckbox.swift
This file contains hidden or 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 @@ | ||
| // | ||
| // FlintCheckbox.swift | ||
| // Presentation | ||
| // | ||
| // Created by 김호성 on 2026.05.27. | ||
| // | ||
|
|
||
| import UIKit | ||
|
|
||
| package final class FlintCheckbox: UIButton { | ||
|
|
||
| package init() { | ||
| super.init(frame: .zero) | ||
|
|
||
| setImage(.icCheckboxEmpty, for: .normal) | ||
| setImage(.icCheckboxFill, for: .selected) | ||
| } | ||
|
|
||
| required init?(coder: NSCoder) { | ||
| fatalError("init(coder:) has not been implemented") | ||
| } | ||
| } |
15 changes: 15 additions & 0 deletions
15
...ntation/Sources/View/Resource/Assets.xcassets/Icon/Common/24/ic_up.imageset/Contents.json
This file contains hidden or 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,15 @@ | ||
| { | ||
| "images" : [ | ||
| { | ||
| "filename" : "icon.svg", | ||
| "idiom" : "universal" | ||
| } | ||
| ], | ||
| "info" : { | ||
| "author" : "xcode", | ||
| "version" : 1 | ||
| }, | ||
| "properties" : { | ||
| "preserves-vector-representation" : true | ||
| } | ||
| } |
3 changes: 3 additions & 0 deletions
3
...on/Sources/View/Resource/Assets.xcassets/Icon/Common/24/ic_up.imageset/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
130 changes: 130 additions & 0 deletions
130
...n/Sources/View/Scene/Onboarding/TermsAgreement/Cell/TermAgreementCollectionViewCell.swift
This file contains hidden or 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,130 @@ | ||
| // | ||
| // TermAgreementCollectionViewCell.swift | ||
| // Presentation | ||
| // | ||
| // Created by 김호성 on 2026.05.30. | ||
| // | ||
|
|
||
| import UIKit | ||
|
|
||
| import Domain | ||
|
|
||
| package final class TermAgreementCollectionViewCell: BaseCollectionViewListCell { | ||
|
|
||
| // MARK: - Component | ||
|
|
||
| package let termAgreeStackView = UIStackView().then { | ||
| $0.axis = .vertical | ||
| $0.spacing = 0 | ||
| $0.alignment = .fill | ||
| $0.distribution = .equalSpacing | ||
| } | ||
|
|
||
| package let termAgreeHeaderView = UIView() | ||
| package let termAgreeCheckbox = FlintCheckbox() | ||
| package let termAgreeLabel = UILabel().then { | ||
| $0.textColor = .flintWhite | ||
| } | ||
|
|
||
| package lazy var expandButton = UIButton().then { | ||
| $0.setImage(.icDown, for: .normal) | ||
| $0.setImage(.icUp, for: .selected) | ||
| $0.addTarget(self, action: #selector(touchUpInsideExpandButton(_:)), for: .touchUpInside) | ||
| } | ||
|
|
||
| package let termDetailView = UIView().then { | ||
| $0.backgroundColor = .flintGray800 | ||
| $0.layer.cornerRadius = 8 | ||
| $0.isHidden = true | ||
| } | ||
| package let termDetailLabel = UILabel().then { | ||
| $0.textColor = .flintWhite | ||
| $0.numberOfLines = 0 | ||
| } | ||
| package let termDetailMoreButton = UIButton().then { | ||
| $0.setAttributedTitle( | ||
| NSMutableAttributedString(.pretendard(.body2_r_14, text: "자세히 보기")).configured { | ||
| $0.addAttribute(.underlineStyle, value: NSUnderlineStyle.single.rawValue, range: NSRange(location: 0, length: $0.length)) | ||
| }, | ||
| for: .normal | ||
| ) | ||
| $0.setTitleColor(.flintPrimary200, for: .normal) | ||
| } | ||
|
|
||
| // MARK: - Basic | ||
|
|
||
| package override init(frame: CGRect) { | ||
| super.init(frame: frame) | ||
|
|
||
| contentView.backgroundColor = .flintBackground | ||
| } | ||
|
|
||
| required init?(coder: NSCoder) { | ||
| fatalError("init(coder:) has not been implemented") | ||
| } | ||
|
|
||
| package override func prepare() { | ||
| termAgreeCheckbox.removeTarget(nil, action: nil, for: .allEvents) | ||
| } | ||
|
|
||
| // MARK: - Setup | ||
|
|
||
| package override func setHierarchy() { | ||
| contentView.addSubview(termAgreeStackView) | ||
| termAgreeStackView.addArrangedSubviews( | ||
| termAgreeHeaderView, | ||
| termDetailView | ||
| ) | ||
| termAgreeHeaderView.addSubviews( | ||
| termAgreeCheckbox, | ||
| termAgreeLabel, | ||
| expandButton, | ||
| ) | ||
| termDetailView.addSubviews( | ||
| termDetailLabel, | ||
| termDetailMoreButton | ||
| ) | ||
| } | ||
|
|
||
| package override func setLayout() { | ||
| termAgreeStackView.snp.makeConstraints { | ||
| $0.edges.equalToSuperview() | ||
| } | ||
| termAgreeCheckbox.snp.makeConstraints { | ||
| $0.size.equalTo(48) | ||
| $0.leading.verticalEdges.equalToSuperview() | ||
| } | ||
| termAgreeLabel.snp.makeConstraints { | ||
| $0.centerY.equalToSuperview() | ||
| $0.leading.equalTo(termAgreeCheckbox.snp.trailing) | ||
| } | ||
| expandButton.snp.makeConstraints { | ||
| $0.size.equalTo(48) | ||
| $0.trailing.verticalEdges.equalToSuperview() | ||
| } | ||
| termDetailLabel.snp.makeConstraints { | ||
| $0.top.horizontalEdges.equalToSuperview().inset(12) | ||
| } | ||
| termDetailMoreButton.snp.makeConstraints { | ||
| $0.top.equalTo(termDetailLabel.snp.bottom) | ||
| $0.height.equalTo(48) | ||
| $0.trailing.equalToSuperview().inset(12) | ||
| $0.bottom.equalToSuperview() | ||
| } | ||
| } | ||
|
|
||
| // MARK: - Public Function | ||
|
|
||
| package func configure(_ signUpTerm: SignUpTerm) { | ||
| termAgreeLabel.attributedText = .pretendard(.body1_r_16, text: signUpTerm.title) | ||
| termDetailLabel.attributedText = .pretendard(.body2_r_14, text: signUpTerm.description) | ||
| } | ||
|
|
||
| // MARK: - Private Function | ||
|
|
||
| @objc private func touchUpInsideExpandButton(_ sender: UIButton) { | ||
| sender.isSelected.toggle() | ||
| termDetailView.isHidden = !sender.isSelected | ||
| invalidateIntrinsicContentSize() | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
아름다운 enum이네요 LTGM