Skip to content

Commit c5c1e12

Browse files
authored
[NL-6] Onboarding 초안 구현 (#23)
* [NL-6] : SplashVC 생성 - SplashVC view 완성 * [NL-6] : LaunchScreen 설정 - 로고 출력과 백그라운드 색상 변경 - appdelegate에서 screen 노출 시간 설정 * [NL-6] : SplashViewModel 생성 - 시작하기 버튼 이벤트 발생시 화면 이동 할 수 있도록 setting * [NL-6] : Splash 오류 해결 * [NL-6] : Onbarding 화면 생성 - 성별 까지 구현 완료 # Conflicts: # App/Sources/AppDelegate.swift # Core/Project.swift * [NL-6] : TimeRange BottomSheet 생성 * [NL-6] : Onboarding viewModel 생성 - 기존 PR 수정사항 반영 * [NL-6] : 애니메이션 효과 추가 - keyboard input 추가 * [NL-6] - 약관동의 modal 완성- Notion 페이지 링크 부착 필요 - 완료 버튼 클릭시 API 부착 필요 * [NL-6] - 완료 버튼 클릭시 API 호출 할 수 있도록 구현 - delegate pattern 사용 * [NL-6] : 기타 버그 수정 * [NL-6] : - Refactor - PR 내용 수정
1 parent 9be7217 commit c5c1e12

File tree

21 files changed

+895
-183
lines changed

21 files changed

+895
-183
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "Icon.svg",
5+
"idiom" : "universal"
6+
}
7+
],
8+
"info" : {
9+
"author" : "xcode",
10+
"version" : 1
11+
}
12+
}
Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "checkGray.svg",
5+
"idiom" : "universal"
6+
}
7+
],
8+
"info" : {
9+
"author" : "xcode",
10+
"version" : 1
11+
}
12+
}
Lines changed: 3 additions & 0 deletions
Loading

DesignSystem/DesignSystem/Resources/Images.xcassets/iconArrow.imageset/Contents.json renamed to DesignSystem/DesignSystem/Resources/Images.xcassets/icon_Arrow.imageset/Contents.json

File renamed without changes.

DesignSystem/DesignSystem/Resources/Images.xcassets/iconArrow.imageset/line.svg renamed to DesignSystem/DesignSystem/Resources/Images.xcassets/icon_Arrow.imageset/line.svg

File renamed without changes.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "line.svg",
5+
"idiom" : "universal"
6+
}
7+
],
8+
"info" : {
9+
"author" : "xcode",
10+
"version" : 1
11+
}
12+
}
Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
//
2+
// AgreementCell.swift
3+
// FeatureLayer
4+
//
5+
// Created by 최재혁 on 7/30/25.
6+
//
7+
8+
import UIKit
9+
import DesignSystem
10+
11+
import SnapKit
12+
import Then
13+
14+
protocol AgreementCellDelegate : AnyObject {
15+
func agreementCell(_ cell: AgreementCell, didChangeAgreement isAgreed: Bool)
16+
func agreementCellDidTapDetail(_ cell : AgreementCell)
17+
}
18+
19+
final class AgreementCell : UICollectionViewCell {
20+
static let identifier = "AgreementCell"
21+
22+
weak var delegate : AgreementCellDelegate?
23+
24+
let checkBox : CheckBox = CheckBox().then {
25+
$0.isUserInteractionEnabled = true
26+
}
27+
28+
private let detailButton : UIButton = UIButton().then {
29+
$0.setImage(STImages.line.image, for: .normal)
30+
$0.tintColor = STColors.gray5.color
31+
}
32+
33+
override init(frame: CGRect) {
34+
super.init(frame: frame)
35+
36+
setupView()
37+
bindActions()
38+
}
39+
40+
required init?(coder: NSCoder) {
41+
fatalError("init(coder:) has not been implemented")
42+
}
43+
44+
private func setupView() {
45+
contentView.addSubview(checkBox)
46+
contentView.addSubview(detailButton)
47+
48+
checkBox.snp.makeConstraints {
49+
$0.leading.equalToSuperview().offset(24)
50+
$0.centerY.equalToSuperview()
51+
}
52+
53+
detailButton.snp.makeConstraints {
54+
$0.trailing.equalToSuperview().offset(-24)
55+
$0.centerY.equalToSuperview()
56+
$0.width.height.equalTo(16)
57+
}
58+
}
59+
60+
private func bindActions() {
61+
checkBox.addTarget(self, action: #selector(checkBoxTapped), for: .valueChanged)
62+
detailButton.addTarget(self, action: #selector(detailButtonTapped), for: .touchUpInside)
63+
}
64+
65+
@objc private func checkBoxTapped() {
66+
delegate?.agreementCell(self, didChangeAgreement: checkBox.isSelected)
67+
}
68+
69+
@objc private func detailButtonTapped() {
70+
delegate?.agreementCellDidTapDetail(self)
71+
}
72+
73+
func configure(with item: AgreementItem) {
74+
var requiredText : String
75+
switch item.id {
76+
case .all:
77+
requiredText = ""
78+
case .service, .privacy, .age :
79+
requiredText = item.isRequired ? "(필수) " : "(선택) "
80+
}
81+
checkBox.title = requiredText + item.title
82+
checkBox.isSelected = item.isAgreed
83+
detailButton.isHidden = !item.hasDetail // 상세 보기 유무에 따라 버튼 숨김/표시
84+
}
85+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
//
2+
// AgreementItem.swift
3+
// FeatureLayer
4+
//
5+
// Created by 최재혁 on 7/30/25.
6+
//
7+
8+
import Foundation
9+
10+
enum AgreementType {
11+
case all
12+
case service
13+
case privacy
14+
case age
15+
}
16+
17+
struct AgreementItem {
18+
let id: AgreementType
19+
let title: String
20+
let isRequired: Bool // 필수 약관 여부
21+
var isAgreed: Bool // 동의 여부
22+
let hasDetail: Bool // 상세 보기 유무 ('>' 아이콘 표시 여부)
23+
}

0 commit comments

Comments
 (0)