Skip to content

Commit 5dad37a

Browse files
chore: 분실물 작성 사소한 수정
오늘 날짜가 기본값으로 들어있도록 수정했습니다.
1 parent 75f4676 commit 5dad37a

2 files changed

Lines changed: 13 additions & 5 deletions

File tree

Koin/Presentation/LostItem/PostLostItem/SubViews/AddLostItemCollectionView/AddLostItemCollectionView.swift

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,13 @@ final class AddLostItemCollectionView: UICollectionView, UICollectionViewDataSou
4343
register(AddLostItemFooterView.self, forSupplementaryViewOfKind: UICollectionView.elementKindSectionFooter, withReuseIdentifier: AddLostItemFooterView.identifier)
4444
dataSource = self
4545
delegate = self
46-
articles.append(PostLostItemRequest(type: .found, category: "", location: "", foundDate: "", content: "", images: [], registeredAt: "", updatedAt: ""))
46+
47+
let formattedDate: String = {
48+
let formatter = DateFormatter()
49+
formatter.dateFormat = "yyyy년 M월 d일"
50+
return formatter.string(from: Date())
51+
}()
52+
articles.append(PostLostItemRequest(type: .found, category: "", location: "", foundDate: formattedDate, content: "", images: [], registeredAt: "", updatedAt: ""))
4753
}
4854
}
4955

@@ -101,7 +107,12 @@ extension AddLostItemCollectionView {
101107
footerCancellables.removeAll()
102108
footerView.addItemButtonPublisher.sink { [weak self] in
103109
guard let strongSelf = self else { return }
104-
self?.articles.append(PostLostItemRequest(type: .found, category: "", location: "", foundDate: "", content: "", images: [], registeredAt: "", updatedAt: ""))
110+
let formattedDate: String = {
111+
let formatter = DateFormatter()
112+
formatter.dateFormat = "yyyy년 M월 d일"
113+
return formatter.string(from: Date())
114+
}()
115+
self?.articles.append(PostLostItemRequest(type: .found, category: "", location: "", foundDate: formattedDate, content: "", images: [], registeredAt: "", updatedAt: ""))
105116
self?.reloadData()
106117
self?.collectionViewLayout.invalidateLayout()
107118
self?.heightChangedPublisher.send()

Koin/Presentation/LostItem/PostLostItem/SubViews/AddLostItemCollectionView/AddLostItemCollectionViewCell.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -275,9 +275,6 @@ final class AddLostItemCollectionViewCell: UICollectionViewCell {
275275
if let dateValue = dateFormatter.date(from: model.foundDate) {
276276
dropdownView.dateValue = dateValue
277277
}
278-
279-
let maxCharacters = 1000
280-
contentTextCountLabel.text = "\(contentTextView.text.count)/\(maxCharacters)"
281278
}
282279
}
283280

0 commit comments

Comments
 (0)