Skip to content

Commit

Permalink
Auto stash before cherry pick of "[Add] CDS-Mobile1#27 - 프로젝트 파일"
Browse files Browse the repository at this point in the history
  • Loading branch information
joonBaek12 committed Jun 1, 2023
1 parent c44d168 commit c272606
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 16 deletions.
4 changes: 4 additions & 0 deletions Instagram-iOS/Instagram-iOS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
372AAF732A20E7FC009212A8 /* DMTableviewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 372AAF722A20E7FC009212A8 /* DMTableviewCell.swift */; };
372AAF752A20E808009212A8 /* DMCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 372AAF742A20E808009212A8 /* DMCollectionViewCell.swift */; };
372AAF772A20F90F009212A8 /* DMTableViewHeader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 372AAF762A20F90F009212A8 /* DMTableViewHeader.swift */; };
372AAF952A24E3C4009212A8 /* DMTableViewCellHeader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 372AAF942A24E3C4009212A8 /* DMTableViewCellHeader.swift */; };
37C4BF062A1D3E86006FBFF6 /* SF-Pro-Text-Bold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 37C4BF052A1D3E86006FBFF6 /* SF-Pro-Text-Bold.ttf */; };
3E6CF47A2A14F43500DC3B2B /* BaseViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E6CF4792A14F43500DC3B2B /* BaseViewController.swift */; };
3E6CF47C2A14F63700DC3B2B /* BaseTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E6CF47B2A14F63700DC3B2B /* BaseTableViewCell.swift */; };
Expand Down Expand Up @@ -57,6 +58,7 @@
372AAF722A20E7FC009212A8 /* DMTableviewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DMTableviewCell.swift; sourceTree = "<group>"; };
372AAF742A20E808009212A8 /* DMCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DMCollectionViewCell.swift; sourceTree = "<group>"; };
372AAF762A20F90F009212A8 /* DMTableViewHeader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DMTableViewHeader.swift; sourceTree = "<group>"; };
372AAF942A24E3C4009212A8 /* DMTableViewCellHeader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DMTableViewCellHeader.swift; sourceTree = "<group>"; };
37C4BF052A1D3E86006FBFF6 /* SF-Pro-Text-Bold.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "SF-Pro-Text-Bold.ttf"; sourceTree = "<group>"; };
37D49A6D2A17CE5C00FBCA0F /* UIStackView+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIStackView+.swift"; sourceTree = "<group>"; };
37D49A6F2A18891600FBCA0F /* UITextfield+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UITextfield+.swift"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -121,6 +123,7 @@
372AAF722A20E7FC009212A8 /* DMTableviewCell.swift */,
372AAF742A20E808009212A8 /* DMCollectionViewCell.swift */,
372AAF762A20F90F009212A8 /* DMTableViewHeader.swift */,
372AAF942A24E3C4009212A8 /* DMTableViewCellHeader.swift */,
);
path = Cell;
sourceTree = "<group>";
Expand Down Expand Up @@ -460,6 +463,7 @@
7E0148C02A1BEA9A0036147D /* StoryCollectionViewCell.swift in Sources */,
3E9683E62A16392900D6DD30 /* ImageLiteral.swift in Sources */,
3EEE76682A176C9100D0B80E /* NewPostImageCollectionViewCell.swift in Sources */,
372AAF952A24E3C4009212A8 /* DMTableViewCellHeader.swift in Sources */,
372AAF772A20F90F009212A8 /* DMTableViewHeader.swift in Sources */,
7E8DF5A02A1238840023948F /* Models.swift in Sources */,
7E0148BE2A1BE8780036147D /* StoryCollectionView.swift in Sources */,
Expand Down
87 changes: 71 additions & 16 deletions Instagram-iOS/Instagram-iOS/Screens/DMList/DMList.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,25 @@ final class DMListViewController: BaseViewController {

// MARK: - UI Property

let header = UIView()

private let headerTitleLabel: UILabel = {
let label = UILabel()
label.font = .bodyKorBold
label.textColor = .black1
label.text = "즐겨찾기"
return label
}()

private let searchTextField: UITextField = {
let textField = UITextField()
textField.backgroundColor = .gray5
textField.font = .body
//TODO: - 추후 placeholder 세팅 시 추가하겠습니다
// textField.placeholder = "검색"
return textField
}()

let userNameLabel: UILabel = {
let label = UILabel()
label.font = .title1
Expand Down Expand Up @@ -48,18 +67,21 @@ final class DMListViewController: BaseViewController {

private let DMListTableView: UITableView = {
let tableView = UITableView()
tableView.register(DMTableViewCellHeader.self, forHeaderFooterViewReuseIdentifier: DMTableViewCellHeader.identifier)
tableView.register(DMTableviewCell.self, forCellReuseIdentifier: DMTableviewCell.identifier)
return tableView
}()


// MARK: - Life Cycle

override func viewDidLoad() {
super.viewDidLoad()

// setSearchTextFieldUI()
configDelegate()
}
setSearchTextFieldUI()
}

// MARK: - Setting

Expand All @@ -85,11 +107,27 @@ final class DMListViewController: BaseViewController {
videoCallButton.setImage(ImageLiteral.NavBar.DMList.camera, for: .normal)
newMessageButton.setImage(ImageLiteral.NavBar.DMList.newDM, for: .normal)
navigationItem.leftBarButtonItems = [backButtonItem, userNameLabelItem, arrowDownButtonItem]
navigationItem.rightBarButtonItems = [videoCallButtonItem, newMessageButtonItem]
navigationItem.rightBarButtonItems = [newMessageButtonItem, videoCallButtonItem]
}

override func setLayout() {

DMListTableView.tableHeaderView = header

view.addSubview(header)
header.snp.makeConstraints {
$0.top.equalTo(view.safeAreaLayoutGuide)
$0.leading.trailing.equalToSuperview()
$0.height.equalTo(155)
}

header.addSubview(searchTextField)
searchTextField.snp.makeConstraints {
$0.top.centerX.equalToSuperview()
$0.leading.equalToSuperview().offset(16)
$0.height.equalTo(35)
}

view.addSubview(customNaviView)
customNaviView.snp.makeConstraints {
$0.top.equalTo(view.safeAreaLayoutGuide.snp.top)
Expand All @@ -109,28 +147,45 @@ final class DMListViewController: BaseViewController {
$0.edges.equalToSuperview()
}
}

private func setSearchTextFieldUI() {

// MARK: - Action Helper

// MARK: - Custom Method
searchTextField.layer.cornerRadius = 10
searchTextField.backgroundColor = .gray5
searchTextField.font = .body
// searchTextField.attributedPlaceholder = NSAttributedString(string: "검색", attributes: [NSAttributedString.Key.foregroundColor: UIColor.lightGray])

// private func setSearchTextFieldUI() {
//
// searchTextField.layer.cornerRadius = 10
// searchTextField.backgroundColor = .gray5
// searchTextField.font = .body
//// searchTextField.attributedPlaceholder = NSAttributedString(string: "검색", attributes: [NSAttributedString.Key.foregroundColor: UIColor.lightGray])
//
// }
}
}

//MARK: - UITableViewDelegate
extension DMListViewController: UITableViewDelegate {

}

extension DMListViewController: UITableViewDelegate {}

//MARK: - UITableViewDataSource

extension DMListViewController: UITableViewDataSource {

//MARK: - Header

// func numberOfSections(in tableView: UITableView) -> Int {
// return 1 // set your desired number of sections
// }

func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
guard let header = tableView.dequeueReusableHeaderFooterView(withIdentifier: DMTableViewCellHeader.identifier) as? DMTableViewCellHeader else {
fatalError("header fail")
}

return header
}

func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
return 47
}

//MARK: - Cells

func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 10
}
Expand Down

0 comments on commit c272606

Please sign in to comment.