@@ -44,8 +44,8 @@ final class ReportRegistrationViewController: BaseViewController<ReportRegistrat
4444 static let registerButtonHeight : CGFloat = 54
4545 static let categoryBottomSheetHeight : CGFloat = 362
4646 static let cameraBottomSheetHeight : CGFloat = 174
47- static let contentCountLabelTopSpacing : CGFloat = 6
48- static let contentCountLabelHeight : CGFloat = 18
47+ static let countLabelTopSpacing : CGFloat = 6
48+ static let countLabelHeight : CGFloat = 18
4949 }
5050
5151 private typealias Section = ReportRegistrationViewController . CollectionViewSection
@@ -62,12 +62,16 @@ final class ReportRegistrationViewController: BaseViewController<ReportRegistrat
6262 private let cameraButton = ReportCameraButton ( frame: . zero)
6363 private let photoCollectionView = UICollectionView ( frame: . zero, collectionViewLayout: . init( ) )
6464 private let categoryTextView = ReportTextView ( type: . combo, placeholder: " 카테고리 선택 " )
65- private let reportTitleTextView = ReportTextView ( type: . editable, placeholder: " 제보 제목을 작성해주세요. " )
65+ private let reportTitleTextView = ReportTextView (
66+ type: . editable,
67+ placeholder: " 제보 제목을 작성해주세요. "
68+ , maxLength: 50 )
6669 private let reportContentTextView = ReportTextView (
6770 type: . editable,
6871 placeholder: " 어떤 위험인지 간단히 설명해주세요. " ,
6972 maxLength: 150 )
7073 private let locationTextView = ReportTextView ( type: . nonEditable, placeholder: " 현재 위치 검색 " )
74+ private let titleCountLabel = UILabel ( )
7175 private let contentTextCountLabel = UILabel ( )
7276 private let locationButton = LocationButton ( )
7377 private let registerButton = PrimaryButton ( buttonState: . disabled, buttonTitle: " 제출하기 " )
@@ -127,6 +131,9 @@ final class ReportRegistrationViewController: BaseViewController<ReportRegistrat
127131 } ,
128132 for: . touchUpInside)
129133
134+ titleCountLabel. font = BitnagilFont . init ( style: . caption1, weight: . medium) . font
135+ titleCountLabel. textColor = BitnagilColor . gray80
136+
130137 contentTextCountLabel. font = BitnagilFont . init ( style: . caption1, weight: . medium) . font
131138 contentTextCountLabel. textColor = BitnagilColor . gray80
132139
@@ -148,6 +155,7 @@ final class ReportRegistrationViewController: BaseViewController<ReportRegistrat
148155 scrollContentView. addSubview ( collectionViewTitleLabel)
149156 scrollContentView. addSubview ( categoryTitleLabel)
150157 scrollContentView. addSubview ( nameTitleLabel)
158+ scrollContentView. addSubview ( titleCountLabel)
151159 scrollContentView. addSubview ( contentTitleLabel)
152160 scrollContentView. addSubview ( locationTitleLabel)
153161 scrollContentView. addSubview ( cameraButton)
@@ -238,9 +246,20 @@ final class ReportRegistrationViewController: BaseViewController<ReportRegistrat
238246 . equalTo ( Layout . textViewHeight)
239247 }
240248
241- categoryTitleLabel . snp. makeConstraints { make in
249+ titleCountLabel . snp. makeConstraints { make in
242250 make. top
243251 . equalTo ( reportTitleTextView. snp. bottom)
252+ . offset ( Layout . countLabelTopSpacing)
253+
254+ make. height
255+ . equalTo ( Layout . countLabelHeight)
256+
257+ make. trailing. equalTo ( reportTitleTextView)
258+ }
259+
260+ categoryTitleLabel. snp. makeConstraints { make in
261+ make. top
262+ . equalTo ( titleCountLabel. snp. bottom)
244263 . offset ( Layout . titleLabelTopSpacing)
245264
246265 make. leading
@@ -294,13 +313,13 @@ final class ReportRegistrationViewController: BaseViewController<ReportRegistrat
294313 contentTextCountLabel. snp. makeConstraints { make in
295314 make. top
296315 . equalTo ( reportContentTextView. snp. bottom)
297- . offset ( Layout . contentCountLabelTopSpacing )
316+ . offset ( Layout . countLabelTopSpacing )
298317
299318 make. trailing
300319 . equalToSuperview ( )
301320 . offset ( - Layout. horizontalInset)
302321
303- make. height. equalTo ( Layout . contentCountLabelHeight )
322+ make. height. equalTo ( Layout . countLabelHeight )
304323 }
305324
306325 locationTitleLabel. snp. makeConstraints { make in
@@ -374,17 +393,22 @@ final class ReportRegistrationViewController: BaseViewController<ReportRegistrat
374393 viewModel. output. titlePublisher
375394 . receive ( on: DispatchQueue . main)
376395 . sink { [ weak self] title in
377- self ? . reportTitleTextView. configure ( text: title ?? " " )
396+ guard let self else { return }
397+
398+ self . reportTitleTextView. configure ( text: title ?? " " )
399+ let title = title ?? " "
400+ self . titleCountLabel. text = " \( title. count) / \( viewModel. output. maxTitleLength) "
378401 }
379402 . store ( in: & cancellables)
380403
381404 viewModel. output. contentPublisher
382405 . receive ( on: DispatchQueue . main)
383406 . sink { [ weak self] content in
384- self ? . reportContentTextView. configure ( text: content ?? " " )
407+ guard let self else { return }
408+ self . reportContentTextView. configure ( text: content ?? " " )
385409
386410 let content = content ?? " "
387- self ? . contentTextCountLabel. text = " \( content. count) / 150 "
411+ self . contentTextCountLabel. text = " \( content. count) / \( viewModel . output . maxContentLength ) "
388412 }
389413 . store ( in: & cancellables)
390414
0 commit comments