Skip to content

Commit

Permalink
[Chore] CDS-Mobile1#27 - MessageLabel 레이아웃 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
joonBaek12 committed Jun 4, 2023
1 parent ea56562 commit e4fb03f
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@ final class DMTableViewHeader: UIView {
return textField
}()

private let sectionLabel: UILabel = {
let label = UILabel()
label.font = .bodyKorBold
label.textColor = .black1
label.text = "메시지"
return label
}()

override init(frame: CGRect) {
super.init(frame: frame)

Expand Down Expand Up @@ -87,6 +95,12 @@ final class DMTableViewHeader: UIView {
$0.leading.equalToSuperview().offset(14)
$0.height.equalTo(90)
}

addSubview(sectionLabel)
sectionLabel.snp.makeConstraints {
$0.leading.equalToSuperview().offset(16)
$0.bottom.equalToSuperview().offset(-8)
}
}

private func setSearchTextFieldUI() {
Expand Down
29 changes: 16 additions & 13 deletions Instagram-iOS/Instagram-iOS/Screens/DMList/DMList.swift
Original file line number Diff line number Diff line change
Expand Up @@ -99,22 +99,25 @@ final class DMListViewController: BaseViewController {

extension DMListViewController: UITableViewDelegate {
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
switch section {
case 0:
return DMTableViewHeader()
default:
guard let header = tableView.dequeueReusableHeaderFooterView(withIdentifier: DMTableViewCellHeader.identifier) as? DMTableViewCellHeader else {fatalError("header fail")}
return header
}
// switch section {
// case 0:
// return DMTableViewHeader()
// default:
// guard let header = tableView.dequeueReusableHeaderFooterView(withIdentifier: DMTableViewCellHeader.identifier) as? DMTableViewCellHeader else {fatalError("header fail")}
// return header
// }
return DMTableViewHeader()
}

func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
switch section {
case 0:
return 172
default:
return 47
}
// switch section {
// case 0:
// return 172
// default:
// return 47
// }

return 172 + 42
}
}

Expand Down

0 comments on commit e4fb03f

Please sign in to comment.