@@ -6,12 +6,6 @@ class InterestsViewController: UIViewController {
6
6
7
7
var selectedInterestsButton : UIButton ?
8
8
9
- let scrollView = UIScrollView ( ) . then {
10
- $0. backgroundColor = . white
11
- }
12
-
13
- let contentView = UIView ( )
14
-
15
9
let numberLabel = UILabel ( ) . then {
16
10
$0. text = " 5/5 "
17
11
$0. textColor = . red
@@ -36,6 +30,7 @@ class InterestsViewController: UIViewController {
36
30
37
31
let nextButton = ActualGradientButton ( ) . then {
38
32
$0. setTitle ( " 다음 " , for: . normal)
33
+ $0. isEnabled = true
39
34
$0. backgroundColor = . red
40
35
$0. layer. cornerRadius = 25
41
36
$0. addTarget ( self , action: #selector( nextButtonTapped) , for: . touchUpInside)
@@ -53,26 +48,14 @@ class InterestsViewController: UIViewController {
53
48
private func setupLayout( ) {
54
49
view. backgroundColor = . white
55
50
navigationItem. title = " 나의 정보 "
56
- setupScrollView ( )
57
-
58
- view. addSubview ( scrollView)
59
- scrollView. addSubview ( contentView)
60
- contentView. addSubview ( numberLabel)
61
- contentView. addSubview ( titleLabel)
62
- contentView. addSubview ( descriptionLabel)
63
- contentView. addSubview ( nextButton)
64
-
65
- scrollView. snp. makeConstraints { make in
66
- make. edges. equalTo ( view. safeAreaLayoutGuide)
67
- }
68
-
69
- contentView. snp. makeConstraints { make in
70
- make. edges. equalTo ( scrollView)
71
- make. width. equalTo ( scrollView)
72
- }
51
+
52
+ view. addSubview ( numberLabel)
53
+ view. addSubview ( titleLabel)
54
+ view. addSubview ( descriptionLabel)
55
+ view. addSubview ( nextButton)
73
56
74
57
numberLabel. snp. makeConstraints { make in
75
- make. top. leading. trailing. equalToSuperview ( ) . inset ( 20 )
58
+ make. top. leading. trailing. equalTo ( view . safeAreaLayoutGuide ) . inset ( 20 )
76
59
}
77
60
78
61
titleLabel. snp. makeConstraints { make in
@@ -93,11 +76,6 @@ class InterestsViewController: UIViewController {
93
76
}
94
77
}
95
78
96
- private func setupScrollView( ) {
97
- // 스크롤 뷰와 컨텐츠 뷰 설정을 추가합니다.
98
- }
99
-
100
-
101
79
private func setupButtons( ) {
102
80
interests. enumerated ( ) . forEach { ( index, interest) in
103
81
let button = UIButton ( ) . then {
@@ -111,7 +89,7 @@ class InterestsViewController: UIViewController {
111
89
$0. addTarget ( self , action: #selector( interestButtonTapped ( _: ) ) , for: . touchUpInside)
112
90
}
113
91
buttons. append ( button)
114
- contentView . addSubview ( button)
92
+ view . addSubview ( button)
115
93
116
94
button. snp. makeConstraints { make in
117
95
if index == 0 {
@@ -123,11 +101,6 @@ class InterestsViewController: UIViewController {
123
101
make. height. equalTo ( 50 )
124
102
}
125
103
}
126
-
127
- // contentView의 bottom을 마지막 버튼의 bottom에 연결하여 스크롤뷰의 컨텐츠 사이즈를 결정합니다.
128
- contentView. snp. makeConstraints { make in
129
- make. bottom. equalTo ( buttons. last!. snp. bottom) . offset ( 20 )
130
- }
131
104
}
132
105
133
106
@objc func interestButtonTapped( _ sender: UIButton ) {
@@ -151,15 +124,18 @@ class InterestsViewController: UIViewController {
151
124
}
152
125
}
153
126
154
- @objc private func nextButtonTapped( ) {
155
- if selectedInterestsButton != nil {
156
- // 선택된 관심사를 처리하는 로직을 여기에 추가합니다.
157
- // 예를 들어 다음 화면으로 넘어가거나 선택된 관심사 정보를 저장합니다.
158
- } else {
159
- // 관심사가 선택되지 않았을 경우 사용자에게 알립니다.
160
- showAlertForInterestsSelection ( )
127
+ @objc func nextButtonTapped( ) {
128
+ // 선택된 버튼이 있는지 확인
129
+ guard selectedInterestsButton != nil else {
130
+ // 경고 메시지 표시 또는 사용자에게 선택하라고 알림
131
+ showAlertForInterestsSelection ( )
132
+ return
133
+ }
134
+ print ( " next favorite " )
135
+
136
+ let favoriteVC = MyFavoriteListViweController ( )
137
+ navigationController? . pushViewController ( favoriteVC, animated: true )
161
138
}
162
- }
163
139
164
140
private func showAlertForInterestsSelection( ) {
165
141
let alert = UIAlertController ( title: " 관심사 선택 " , message: " 계속하려면 관심사를 선택해주세요. " , preferredStyle: . alert)
0 commit comments