Skip to content

Commit

Permalink
๐Ÿ”จ[FIX] : #177 ํ…Œ๋งˆ์„œ๋ฒ„๊ณ ์ณฃ๋‹น
Browse files Browse the repository at this point in the history
  • Loading branch information
comeheredart committed Dec 30, 2021
1 parent 683c013 commit 2d4b7c3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 15 deletions.
4 changes: 2 additions & 2 deletions ChaRo-iOS/ChaRo-iOS/Source/Models/ThemeDataModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ struct ThemeDataModel: Codable {

// MARK: - TotalDrive
struct TotalDrive: Codable {
let lastId: Int
let lastID: Int
let lastCount: Int
let drive: [Drive]
let drive: [DriveElement]
}


Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class ThemePostAllTVC: UITableViewCell {
static let identifier = "ThemePostAllTVC"
var cellDelegate: ThemeCollectionViewCellDelegate?
var postDelegate: PostIdDelegate?
var selectedDriveList: [Drive] = []
var selectedDriveList: [DriveElement] = []
private var cellCount = 0

//MARK:- Life Cycle
Expand Down Expand Up @@ -89,16 +89,16 @@ extension ThemePostAllTVC: UICollectionViewDelegate, UICollectionViewDataSource,
cell.imageView.layer.cornerRadius = 10
//์š”์†Œ ๋ณ€์ˆ˜ํ™”
let element = selectedDriveList[indexPath.row]
var tags = [element.drive[indexPath.row].region, element.drive[indexPath.row].theme,
element.drive[indexPath.row].warning ?? ""] as [String]
var tags = [element.region, element.theme,
element.warning ?? ""] as [String]


cell.setData(image: element.drive[indexPath.row].image,
title: element.drive[indexPath.row].title,
cell.setData(image: element.image,
title: element.title,
tagCount: tags.count,
tagArr: tags,
isFavorite: element.drive[indexPath.row].isFavorite,
postID: element.drive[indexPath.row].postID)
isFavorite: element.isFavorite,
postID: element.postID)

cell.titleLabel.font = .notoSansBoldFont(ofSize: 17)

Expand Down Expand Up @@ -146,10 +146,8 @@ extension ThemePostAllTVC: UICollectionViewDelegate, UICollectionViewDataSource,
extension ThemePostAllTVC {
func findDriveElementFrom(postId: Int) -> DriveElement?{
for element in selectedDriveList {
for driveElement in element.drive {
if driveElement.postID == postId {
return driveElement
}
if element.postID == postId {
return element
}
}
return nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class ThemePostVC: UIViewController {
var isFirstLoaded = true
var cellCount = 0
private var selectedTheme = ""
private var selectedDriveList: [Drive] = []
private var selectedDriveList: [DriveElement] = []

//MARK:- Constraint

Expand Down Expand Up @@ -146,7 +146,8 @@ class ThemePostVC: UIViewController {
{
case .success(let driveData):
print(driveData)
if let object = driveData as? TotalDrive {
if let object = driveData as? Drive {
print("์—ฌ๊ธฐ๊นŒ์ง€ ์™“์Œ")
self.cellCount = object.drive.count
self.selectedDriveList = object.drive

Expand Down

0 comments on commit 2d4b7c3

Please sign in to comment.