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
16 changes: 16 additions & 0 deletions FLINT/Data/Sources/Networking/API/TermsAPI.swift
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])
}
68 changes: 68 additions & 0 deletions FLINT/Domain/Sources/Entity/Term/SignUpTerm.swift

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아름다운 enum이네요 LTGM

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
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import Foundation

import Presentation

extension NicknameViewControllerFactory where Self: OnboardingViewModelFactory & ViewControllerFactory {
func makeNicknameViewController() -> NicknameViewController {
return NicknameViewController(onboardingViewModel: makeOnboardingViewModel(), viewControllerFactory: self)
extension NicknameViewControllerFactory where Self: ViewControllerFactory {
func makeNicknameViewController(onboardingViewModel: OnboardingViewModel) -> NicknameViewController {
return NicknameViewController(onboardingViewModel: onboardingViewModel, viewControllerFactory: self)
}
}
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)
}
}
60 changes: 60 additions & 0 deletions FLINT/Presentation/Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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 FLINT/Presentation/Sources/View/Component/FlintCheckbox.swift
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")
}
}
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
}
}
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,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()
}
}
Loading