diff --git a/Instagram-iOS/Instagram-iOS/Screens/DMList/DMList.swift b/Instagram-iOS/Instagram-iOS/Screens/DMList/DMList.swift index 9a740e0..8ec9446 100644 --- a/Instagram-iOS/Instagram-iOS/Screens/DMList/DMList.swift +++ b/Instagram-iOS/Instagram-iOS/Screens/DMList/DMList.swift @@ -13,8 +13,6 @@ final class DMListViewController: BaseViewController { // MARK: - Property - ㅅ - // MARK: - UI Property let userNameLabel: UILabel = { @@ -39,27 +37,37 @@ final class DMListViewController: BaseViewController { let customNaviView = UIView() - private let searchTextField: UITextField = { - let textField = UITextField() - textField.backgroundColor = .gray5 - textField.font = .body - //TODO: - 추후 placeholder 세팅 시 추가하겠습니다 -// textField.placeholder = "검색" - return textField +// private let searchTextField: UITextField = { +// let textField = UITextField() +// textField.backgroundColor = .gray5 +// textField.font = .body +// //TODO: - 추후 placeholder 세팅 시 추가하겠습니다 +//// textField.placeholder = "검색" +// return textField +// }() + + private let DMListTableView: UITableView = { + let tableView = UITableView() + tableView.register(DMTableviewCell.self, forCellReuseIdentifier: DMTableviewCell.identifier) + return tableView }() - - // MARK: - Life Cycle override func viewDidLoad() { super.viewDidLoad() - setSearchTextFieldUI() +// setSearchTextFieldUI() + configDelegate() } // MARK: - Setting + private func configDelegate() { + DMListTableView.delegate = self + DMListTableView.dataSource = self + } + override func setNavigationBar() { super.setNavigationBar() @@ -88,12 +96,17 @@ final class DMListViewController: BaseViewController { $0.leading.trailing.equalToSuperview() } - view.addSubview(searchTextField) - searchTextField.snp.makeConstraints { - $0.top.equalTo(customNaviView.snp.bottom).offset(8) - $0.centerX.equalToSuperview() - $0.leading.equalToSuperview().offset(16) - $0.height.equalTo(35) +// view.addSubview(searchTextField) +// searchTextField.snp.makeConstraints { +// $0.top.equalTo(customNaviView.snp.bottom).offset(8) +// $0.centerX.equalToSuperview() +// $0.leading.equalToSuperview().offset(16) +// $0.height.equalTo(35) +// } + + view.addSubview(DMListTableView) + DMListTableView.snp.makeConstraints { + $0.edges.equalToSuperview() } } @@ -101,12 +114,35 @@ final class DMListViewController: BaseViewController { // MARK: - Custom Method - private func setSearchTextFieldUI() { - - 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 { + +} + +//MARK: - UITableViewDataSource +extension DMListViewController: UITableViewDataSource { + func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + return 10 + } + + func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + let cell = tableView.dequeueReusableCell(withIdentifier: DMTableviewCell.identifier, for: indexPath) as! DMTableviewCell + return cell + } + + func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { + return 74 } + + }