Skip to content

Commit b578179

Browse files
authoredJan 15, 2021
Merge pull request #145 from TeamBeMe/feature/#140
Feature/#140
2 parents 2cf9327 + a2f8e61 commit b578179

9 files changed

+184
-101
lines changed
 

‎BeMe/BeMe/APIService/MyPage/MyPageAnswerService.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ struct MyPageAnswerService {
1414
// getMyAnswer - overLoading Method : 쿼리 개수에 따라서 매개변수 개수가 바뀜
1515
func getMyAnswer(availability: String?, category: Int?, page: Int, query: String?, completion : @escaping (NetworkResult<Any>) -> (Void) ){
1616

17-
_ = category == nil ? "" : String(category!)
17+
let category = category == nil ? "" : String(category!)
1818
let availability = availability == nil ? "" : String(availability!)
1919
let query = query == nil ? "" : String(query!)
2020

@@ -23,7 +23,7 @@ struct MyPageAnswerService {
2323

2424
let params: Parameters = [
2525
"public": "\(availability)",
26-
"availability": "\(availability)",
26+
"category": "\(category)",
2727
"page": "\(page)",
2828
"query": "\(query)"
2929
]

‎BeMe/BeMe/APIService/MyPage/MyPageScrapService.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ struct MyPageScrapService {
1414
// getMyAnswer - overLoading Method : 쿼리 개수에 따라서 매개변수 개수가 바뀜
1515
func getMyScrap(availability: String?, category: Int?, query: String?, page: Int, completion : @escaping (NetworkResult<Any>) -> (Void)){
1616

17-
_ = category == nil ? "" : String(category!)
17+
let category = category == nil ? "" : String(category!)
1818
let availability = availability == nil ? "" : String(availability!)
1919
let query = query == nil ? "" : String(query!)
2020

@@ -23,7 +23,7 @@ struct MyPageScrapService {
2323

2424
let params: Parameters = [
2525
"public": "\(availability)",
26-
"availability": "\(availability)",
26+
"category": "\(category)",
2727
"page": "\(page)",
2828
"query": "\(query)"
2929
]

‎BeMe/BeMe/CustomActionSheet/Cell/FilterCVC.swift

+21-5
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ class FilterCVC: UICollectionViewCell {
1212
@IBOutlet weak var categoryButton: UIButton!
1313
@IBAction func categoryButtonTapped(_ sender: UIButton) {
1414
print(category)
15-
filterCVCDelegate?.setSelectedCategory(index: indexPath)
15+
// filterCVCDelegate?.setSelectedCategory(index: indexPath)
1616
}
1717

1818
static let identifier: String = "FilterCVC"
1919
var category: ExploreCategory?
2020
var indexPath = -1
21-
var filterCVCDelegate: FilterCVCDelegate?
21+
// var filterCVCDelegate: FilterCVCDelegate?
2222

2323

2424
override var isSelected: Bool {
@@ -57,6 +57,22 @@ class FilterCVC: UICollectionViewCell {
5757
}
5858

5959
}
60+
61+
func setButton(selected: Bool) {
62+
if !selected {
63+
print(category)
64+
65+
categoryButton.setBorderWithRadius(borderColor: .veryLightPink, borderWidth: 1, cornerRadius: 4)
66+
categoryButton.backgroundColor = UIColor.white
67+
categoryButton.setTitleColor(.slateGrey, for: .normal)
68+
} else {
69+
categoryButton.setBorderWithRadius(borderColor: .black, borderWidth: 1, cornerRadius: 4)
70+
categoryButton.backgroundColor = UIColor.black
71+
categoryButton.setTitleColor(.white, for: .normal)
72+
}
73+
74+
}
75+
6076
func setButton(text: String) {
6177
categoryButton.setTitle(text, for: .normal)
6278
categoryButton.setBorderWithRadius(borderColor: .veryLightPink, borderWidth: 1, cornerRadius: 4)
@@ -65,6 +81,6 @@ class FilterCVC: UICollectionViewCell {
6581
}
6682
}
6783

68-
protocol FilterCVCDelegate {
69-
func setSelectedCategory(index: Int)
70-
}
84+
//protocol FilterCVCDelegate {
85+
// func setSelectedCategory(index: Int)
86+
//}

‎BeMe/BeMe/CustomActionSheet/VC/CustomActionSheetFilterVC.swift

+114-76
Original file line numberDiff line numberDiff line change
@@ -18,108 +18,133 @@ class CustomActionSheetFilterVC: UIViewController {
1818
@IBOutlet weak var categoryLabel: UILabel!
1919
// 서버통신을 통해 받아오는 값
2020
var categoryArray: [ExploreCategory] = []
21-
// all, public, unpublic
22-
var availablityArray: [Bool] = [false, false, false]
23-
private var filterCVCDelegate: FilterCVCDelegate?
21+
// private var filterCVCDelegate: FilterCVCDelegate?
2422
var fromServer = true
25-
var categorySelected: Int = 0
26-
private var selectedAvailablity: String = "all"
23+
24+
private var selectedCategory: Int?
25+
= nil
26+
27+
private var selectedAvailablity: String? = nil
28+
2729
override func viewDidLoad() {
2830
super.viewDidLoad()
2931
setLabel()
3032
setButton(view: allButton, isSelected: false)
3133
setButton(view: publicButton, isSelected: false)
3234
setButton(view: unpublicButton, isSelected: false)
3335

34-
36+
categoryCollectionView.showsHorizontalScrollIndicator = false
3537
categoryCollectionView.delegate = self
3638
categoryCollectionView.dataSource = self
37-
38-
selectedAvailablity = "all"
39-
allButton.backgroundColor = .black
40-
allButton.setTitleColor(.white, for: .normal)
41-
allButton.setBorderWithRadius(borderColor: .black, borderWidth: 1, cornerRadius: 4)
42-
43-
publicButton.backgroundColor = .white
44-
publicButton.setTitleColor(.slateGrey, for: .normal)
45-
publicButton.setBorderWithRadius(borderColor: .veryLightPink, borderWidth: 1, cornerRadius: 4)
46-
47-
unpublicButton.backgroundColor = .white
48-
unpublicButton.setTitleColor(.slateGrey, for: .normal)
49-
unpublicButton.setBorderWithRadius(borderColor: .veryLightPink, borderWidth: 1, cornerRadius: 4)
50-
51-
52-
// Do any additional setup after loading the view.
39+
40+
availablityButtonSet(availablity: selectedAvailablity)
5341
}
5442

5543
override func viewWillAppear(_ animated: Bool) {
5644

45+
// getSelectedFilterInfo()
5746
setCategoryData()
47+
selectedAvailablity = MypageVC.selectedAvailablity
48+
selectedCategory = MypageVC.selectedCategory
49+
availablityButtonSet(availablity: selectedAvailablity)
5850
}
5951

52+
6053
@IBAction func dismissButtonTapped(_ sender: UIButton) {
6154
NotificationCenter.default.post(name: .init("categoryClose"), object: nil)
6255
self.dismiss(animated: true, completion: nil)
6356
}
6457

6558
@IBAction func allButtonTapped(_ sender: UIButton) {
6659
selectedAvailablity = "all"
67-
allButton.backgroundColor = .black
68-
allButton.setTitleColor(.white, for: .normal)
69-
allButton.setBorderWithRadius(borderColor: .black, borderWidth: 1, cornerRadius: 4)
70-
71-
publicButton.backgroundColor = .white
72-
publicButton.setTitleColor(.slateGrey, for: .normal)
73-
publicButton.setBorderWithRadius(borderColor: .veryLightPink, borderWidth: 1, cornerRadius: 4)
74-
75-
unpublicButton.backgroundColor = .white
76-
unpublicButton.setTitleColor(.slateGrey, for: .normal)
77-
unpublicButton.setBorderWithRadius(borderColor: .veryLightPink, borderWidth: 1, cornerRadius: 4)
60+
availablityButtonSet(availablity: selectedAvailablity)
7861
}
7962

8063
@IBAction func publicButtonTapped(_ sender: UIButton) {
8164
selectedAvailablity = "public"
82-
allButton.backgroundColor = .white
83-
allButton.setTitleColor(.slateGrey, for: .normal)
84-
allButton.setBorderWithRadius(borderColor: .veryLightPink, borderWidth: 1, cornerRadius: 4)
85-
86-
publicButton.backgroundColor = .black
87-
publicButton.setTitleColor(.white, for: .normal)
88-
publicButton.setBorderWithRadius(borderColor: .black, borderWidth: 1, cornerRadius: 4)
89-
90-
91-
92-
unpublicButton.backgroundColor = .white
93-
unpublicButton.setTitleColor(.slateGrey, for: .normal)
94-
unpublicButton.setBorderWithRadius(borderColor: .veryLightPink, borderWidth: 1, cornerRadius: 4)
95-
65+
availablityButtonSet(availablity: selectedAvailablity)
9666
}
9767
@IBAction func unpublicButtonTapped(_ sender: UIButton) {
98-
9968
selectedAvailablity = "unpublic"
100-
allButton.backgroundColor = .white
101-
allButton.setTitleColor(.slateGrey, for: .normal)
102-
allButton.setBorderWithRadius(borderColor: .veryLightPink, borderWidth: 1, cornerRadius: 4)
103-
104-
publicButton.backgroundColor = .white
105-
publicButton.setTitleColor(.slateGrey, for: .normal)
106-
publicButton.setBorderWithRadius(borderColor: .veryLightPink, borderWidth: 1, cornerRadius: 4)
107-
108-
109-
unpublicButton.backgroundColor = .black
110-
unpublicButton.setTitleColor(.white, for: .normal)
111-
unpublicButton.setBorderWithRadius(borderColor: .black, borderWidth: 1, cornerRadius: 4)
112-
69+
availablityButtonSet(availablity: selectedAvailablity)
11370
}
11471

115-
private func selectPrivate(_ sender: UIButton) {
116-
117-
118-
}
72+
11973
@IBAction func applyButtonTapped(_ sender: Any) {
12074

121-
NotificationCenter.default.post(name: .init("categoryClose"), object: nil, userInfo: ["categoryId": categorySelected+1, "selectedAv": selectedAvailablity])
75+
NotificationCenter.default.post(name: .init("categoryClose"), object: nil, userInfo: ["categoryId": selectedCategory , "selectedAv": selectedAvailablity ?? "all"])
12276
self.dismiss(animated: true, completion: nil)
77+
78+
}
79+
80+
// @objc func getSelectedFilterInfo(_ notification: Notification) {
81+
// guard let userInfo = notification.userInfo as? [String: Any] else { return }
82+
// guard let categoryId = userInfo["categoryId"] as? Int else { return }
83+
// guard let selectedAv = userInfo["selectedAv"] as? String else { return }
84+
//
85+
// self.selectedAvailablity = selectedAv
86+
// self.selectedCategory = categoryId
87+
//
88+
// }
89+
// func categoryButtonSet(category: Int){
90+
// <#function body#>
91+
// }
92+
func availablityButtonSet(availablity: String?){
93+
switch availablity {
94+
case "all":
95+
allButton.backgroundColor = .black
96+
allButton.setTitleColor(.white, for: .normal)
97+
allButton.setBorderWithRadius(borderColor: .black, borderWidth: 1, cornerRadius: 4)
98+
99+
publicButton.backgroundColor = .white
100+
publicButton.setTitleColor(.slateGrey, for: .normal)
101+
publicButton.setBorderWithRadius(borderColor: .veryLightPink, borderWidth: 1, cornerRadius: 4)
102+
103+
unpublicButton.backgroundColor = .white
104+
unpublicButton.setTitleColor(.slateGrey, for: .normal)
105+
unpublicButton.setBorderWithRadius(borderColor: .veryLightPink, borderWidth: 1, cornerRadius: 4)
106+
107+
case "public":
108+
allButton.backgroundColor = .white
109+
allButton.setTitleColor(.slateGrey, for: .normal)
110+
allButton.setBorderWithRadius(borderColor: .veryLightPink, borderWidth: 1, cornerRadius: 4)
111+
112+
publicButton.backgroundColor = .black
113+
publicButton.setTitleColor(.white, for: .normal)
114+
publicButton.setBorderWithRadius(borderColor: .black, borderWidth: 1, cornerRadius: 4)
115+
116+
117+
118+
unpublicButton.backgroundColor = .white
119+
unpublicButton.setTitleColor(.slateGrey, for: .normal)
120+
unpublicButton.setBorderWithRadius(borderColor: .veryLightPink, borderWidth: 1, cornerRadius: 4)
121+
case "unpublic":
122+
allButton.backgroundColor = .white
123+
allButton.setTitleColor(.slateGrey, for: .normal)
124+
allButton.setBorderWithRadius(borderColor: .veryLightPink, borderWidth: 1, cornerRadius: 4)
125+
126+
publicButton.backgroundColor = .white
127+
publicButton.setTitleColor(.slateGrey, for: .normal)
128+
publicButton.setBorderWithRadius(borderColor: .veryLightPink, borderWidth: 1, cornerRadius: 4)
129+
130+
131+
unpublicButton.backgroundColor = .black
132+
unpublicButton.setTitleColor(.white, for: .normal)
133+
unpublicButton.setBorderWithRadius(borderColor: .black, borderWidth: 1, cornerRadius: 4)
134+
135+
default:
136+
allButton.backgroundColor = .black
137+
allButton.setTitleColor(.white, for: .normal)
138+
allButton.setBorderWithRadius(borderColor: .black, borderWidth: 1, cornerRadius: 4)
139+
140+
publicButton.backgroundColor = .white
141+
publicButton.setTitleColor(.slateGrey, for: .normal)
142+
publicButton.setBorderWithRadius(borderColor: .veryLightPink, borderWidth: 1, cornerRadius: 4)
143+
144+
unpublicButton.backgroundColor = .white
145+
unpublicButton.setTitleColor(.slateGrey, for: .normal)
146+
unpublicButton.setBorderWithRadius(borderColor: .veryLightPink, borderWidth: 1, cornerRadius: 4)
147+
}
123148
}
124149

125150
func setLabel() {
@@ -146,7 +171,7 @@ class CustomActionSheetFilterVC: UIViewController {
146171

147172
extension CustomActionSheetFilterVC: UICollectionViewDelegate {
148173
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
149-
categorySelected = indexPath.item
174+
selectedCategory = indexPath.item
150175

151176
}
152177
}
@@ -163,9 +188,22 @@ extension CustomActionSheetFilterVC: UICollectionViewDataSource {
163188
for: indexPath) as? FilterCVC else {
164189
return UICollectionViewCell()}
165190
cell.indexPath = indexPath.row
191+
166192
cell.category = self.categoryArray[indexPath.item]
167-
cell.filterCVCDelegate = self
193+
168194
cell.setButton(text: categoryArray[indexPath.item].name)
195+
196+
// if selectedCategory != nil {
197+
// if self.categoryArray[indexPath.item].id == selectedCategory!+1 {
198+
// cell.setButton(selected: true)
199+
// }
200+
// } else {
201+
//
202+
// }
203+
204+
205+
// cell.filterCVCDelegate = self
206+
169207

170208
return cell
171209

@@ -181,7 +219,7 @@ extension CustomActionSheetFilterVC: UICollectionViewDataSource {
181219
}
182220

183221
if cell.isSelected {
184-
categorySelected = 0
222+
selectedCategory = 0
185223
collectionView.deselectItem(at: indexPath, animated: false)
186224
return false
187225
} else {
@@ -233,10 +271,10 @@ extension CustomActionSheetFilterVC {
233271
}
234272
}
235273
}
236-
237-
extension CustomActionSheetFilterVC: FilterCVCDelegate {
238-
func setSelectedCategory(index: Int) {
239-
240-
}
241-
242-
}
274+
//
275+
//extension CustomActionSheetFilterVC: FilterCVCDelegate {
276+
// func setSelectedCategory(index: Int) {
277+
//
278+
// }
279+
//
280+
//}

‎BeMe/BeMe/Mypage/Cells/MypageCRV.swift

+5-1
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ class MypageCRV: UICollectionReusableView {
7373

7474
@IBAction func deleteButtonTapped(_ sender: UIButton) {
7575
setKeywordLabel(label: searchTextField, keyword: "")
76+
NotificationCenter.default.post(name: .init("keyword"), object: nil, userInfo: ["keyword": ""])
7677
MypageCRVDelegate?.deleteButtonSearch()
7778
}
7879

@@ -91,6 +92,7 @@ class MypageCRV: UICollectionReusableView {
9192
moveHighLightBar(to: sender)
9293
}
9394
@IBAction func searchButtonTapped(_ sender: UIButton) {
95+
NotificationCenter.default.post(name: .init("keyword"), object: nil, userInfo: ["keyword": searchTextField.text! ])
9496
MypageCRVDelegate?.searchButtonSearch()
9597
}
9698

@@ -179,11 +181,13 @@ extension MypageCRV: UITextFieldDelegate {
179181
func textFieldDidEndEditing(_ textField: UITextField) {
180182
print("TextFieldDId")
181183
print(textField.text!)
182-
NotificationCenter.default.post(name: .init("keyword"), object: nil, userInfo: ["keyword": textField.text!])
184+
183185
}
184186
func textFieldShouldReturn(_ textField: UITextField) -> Bool {
187+
NotificationCenter.default.post(name: .init("keyword"), object: nil, userInfo: ["keyword": textField.text!])
185188

186189
self.endEditing(true)
190+
187191
MypageCRVDelegate?.searchButtonSearch()
188192
return true
189193
}

‎BeMe/BeMe/Mypage/Cells/MypageOthersScrapTVC.swift

+3-2
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,9 @@ class MypageOthersScrapTVC: UITableViewCell {
7373
}
7474

7575
// writer profile image init
76-
writerImageView.image = UIImage(named: writerImg)
77-
76+
writerImageView.imageFromUrl(writerImg, defaultImgPath: "img")
77+
writerImageView.makeRounded(cornerRadius: 10)
78+
writerImageView.contentMode = .scaleAspectFill
7879

7980
// color
8081
questionLabel.textColor = .black

‎BeMe/BeMe/Mypage/Cells/MypageTabCVC.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ extension MypageTabCVC: UITableViewDataSource, UITableViewDelegate {
6262
.dequeueReusableCell(withIdentifier: MypageResultTVC.identifier, for: indexPath)
6363
as? MypageResultTVC else { return UITableViewCell() }
6464
if (myAnswerArray.count != 0){
65-
tab.setCardView(question: myAnswerArray[indexPath.row].question, questionInfo: myAnswerArray[indexPath.row].category, answerDate: myAnswerArray[indexPath.row].answerDate, isLocked: myAnswerArray[indexPath.row].publicFlag)
65+
tab.setCardView(question: myAnswerArray[indexPath.row].question, questionInfo: myAnswerArray[indexPath.row].category, answerDate: myAnswerArray[indexPath.row].answerDate, isLocked: !myAnswerArray[indexPath.row].publicFlag)
6666

67-
tab.isLocked = myAnswerArray[indexPath.row].publicFlag
67+
tab.isLocked = !myAnswerArray[indexPath.row].publicFlag
6868
tab.answerIdx = myAnswerArray[indexPath.row].id
6969
tab.delegate = self
7070
tab.indexpath = indexPath.row
@@ -81,7 +81,7 @@ extension MypageTabCVC: UITableViewDataSource, UITableViewDelegate {
8181
.dequeueReusableCell(withIdentifier: MypageMyScrapTVC.identifier, for: indexPath)
8282
as? MypageMyScrapTVC else { return UITableViewCell() }
8383

84-
tab.setCardView(question: myScrapArray[indexPath.row].question, questionInfo: myScrapArray[indexPath.row].category, answerDate: myScrapArray[indexPath.row].answerDate, isLocked: myScrapArray[indexPath.row].publicFlag, isScrapped: myScrapArray[indexPath.row].isScrapped!)
84+
tab.setCardView(question: myScrapArray[indexPath.row].question, questionInfo: myScrapArray[indexPath.row].category, answerDate: myScrapArray[indexPath.row].answerDate, isLocked: !myScrapArray[indexPath.row].publicFlag, isScrapped: myScrapArray[indexPath.row].isScrapped!)
8585
tab.selectionStyle = .none
8686
tab.profileEditDelegate = self
8787
tab.answerID = myScrapArray[indexPath.item].id

‎BeMe/BeMe/Mypage/Storyboards/Mypage.storyboard

+1-1
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@
267267
<stackView opaque="NO" contentMode="scaleToFill" spacing="8" translatesAutoresizingMaskIntoConstraints="NO" id="9hK-Vz-EUf">
268268
<rect key="frame" x="20" y="109" width="94" height="20"/>
269269
<subviews>
270-
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="Sn8-Dd-TYt">
270+
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="Sn8-Dd-TYt">
271271
<rect key="frame" x="0.0" y="0.0" width="20" height="20"/>
272272
<constraints>
273273
<constraint firstAttribute="height" constant="20" id="dgQ-eI-F9w"/>

‎BeMe/BeMe/Mypage/VCs/MypageVC.swift

+33-9
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,15 @@ class MypageVC: UIViewController {
1919

2020
//MARK:**- Variable Part**
2121
let mypageCVLayout = MypageCVFlowLayout()
22+
2223
private var filterVCDelegate: FilterVCDelegate?
24+
2325
let mypageCVC = MypageCVC()
2426

27+
static var selectedAvailablity: String?
28+
29+
static var selectedCategory: Int?
30+
2531
private var selectedCategoryId: Int?
2632

2733
private var selectedAv: String?
@@ -65,7 +71,7 @@ class MypageVC: UIViewController {
6571

6672
NotificationCenter.default.addObserver(self, selector: #selector(dismissCategory), name: .init("categoryClose"), object: nil)
6773
NotificationCenter.default.addObserver(self, selector: #selector(getKeyword), name: .init("keyword"), object: nil)
68-
74+
6975
if #available(iOS 11.0, *) {
7076
mypageCollectionView.automaticallyAdjustsScrollIndicatorInsets = false
7177
} else {
@@ -83,14 +89,22 @@ class MypageVC: UIViewController {
8389
self.keyword = keyword
8490

8591
}
92+
8693

8794
@objc func dismissCategory(_ notification: Notification) {
8895
popupBackgroundView.animatePopupBackground(false)
8996
guard let userInfo = notification.userInfo as? [String: Any] else { return }
90-
guard let categoryId = userInfo["categoryId"] as? Int else { return }
97+
98+
guard let categoryId = userInfo["categoryId"] as? Int? else { return }
99+
print("First")
91100
guard let selectedAv = userInfo["selectedAv"] as? String else { return }
101+
print("Second")
92102
self.selectedAv = selectedAv
93-
self.selectedCategoryId = categoryId
103+
self.selectedCategoryId = categoryId == nil ? 1 : categoryId! + 1
104+
105+
MypageVC.selectedAvailablity = selectedAv
106+
MypageVC.selectedCategory = selectedCategoryId
107+
94108
getAnswerData(availability: selectedAv, category: selectedCategoryId, page: 1, query: keyword)
95109
getScrapData(availability: selectedAv, category: selectedCategoryId, page: 1, query: keyword)
96110
}
@@ -256,8 +270,6 @@ extension MypageVC : UICollectionViewDelegateFlowLayout {
256270
headerView.setProfile(nickname: myProfile[0].nickname, img: myProfile[0].profileImg!, visit: String(myProfile[0].continuedVisit), answerCount: String(myProfile[0].answerCount))
257271
}
258272
if chosenImage != nil{
259-
print("바보")
260-
print(chosenImage)
261273
headerView.setProfileImage(img: chosenImage!)
262274
}
263275

@@ -313,9 +325,16 @@ extension MypageVC {
313325
switch result {
314326
case .success(let data):
315327
if let response = data as? MyAnswer{
316-
print("MypageVC getAnswerData 성공")
317328
self.myAnswerArray = response.answers
318329
self.mypageCollectionView.reloadData()
330+
print("MypageVC getAnswerData 성공")
331+
print(self.myAnswerArray)
332+
print(response.answers.count)
333+
print(availability)
334+
print(category)
335+
print(page)
336+
print(query)
337+
319338
}
320339
case .requestErr(let msg):
321340
if let message = msg as? String {
@@ -338,11 +357,16 @@ extension MypageVC {
338357
switch result {
339358
case .success(let data):
340359
if let response = data as? MyScrap{
341-
print("MypageVC getScrapData 성공")
342360
self.myScrapArray = response.answers
343-
// print("getScrapData 안에서")
344-
// print(response)
345361
self.mypageCollectionView.reloadData()
362+
print("MypageVC getScrapData 성공")
363+
print(self.myScrapArray)
364+
print(response.answers.count)
365+
print(availability)
366+
print(category)
367+
print(page)
368+
print(query)
369+
346370
}
347371
case .requestErr(let msg):
348372
if let message = msg as? String {

0 commit comments

Comments
 (0)
Please sign in to comment.