From e0a5d1997a38ebfcb377f374c7c305342d9cbbcb Mon Sep 17 00:00:00 2001 From: Joon Baek Date: Fri, 26 May 2023 22:40:27 +0900 Subject: [PATCH] =?UTF-8?q?[Feat]=20#27=20-=20DMCollectionViewCell,=20DMTa?= =?UTF-8?q?bleViewCell=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Instagram-iOS.xcodeproj/project.pbxproj | 20 ++++- .../DMList/Cell/DMCollectionViewCell.swift | 57 +++++++++++++ .../Screens/DMList/Cell/DMTableviewCell.swift | 82 +++++++++++++++++++ 3 files changed, 155 insertions(+), 4 deletions(-) create mode 100644 Instagram-iOS/Instagram-iOS/Screens/DMList/Cell/DMCollectionViewCell.swift create mode 100644 Instagram-iOS/Instagram-iOS/Screens/DMList/Cell/DMTableviewCell.swift diff --git a/Instagram-iOS/Instagram-iOS.xcodeproj/project.pbxproj b/Instagram-iOS/Instagram-iOS.xcodeproj/project.pbxproj index 4620ba4..8f8c642 100644 --- a/Instagram-iOS/Instagram-iOS.xcodeproj/project.pbxproj +++ b/Instagram-iOS/Instagram-iOS.xcodeproj/project.pbxproj @@ -7,6 +7,8 @@ objects = { /* Begin PBXBuildFile section */ + 372AAF732A20E7FC009212A8 /* DMTableviewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 372AAF722A20E7FC009212A8 /* DMTableviewCell.swift */; }; + 372AAF752A20E808009212A8 /* DMCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 372AAF742A20E808009212A8 /* DMCollectionViewCell.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 */; }; @@ -26,7 +28,6 @@ 3E9683EC2A1654CF00D6DD30 /* UIViewController+.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E9683EB2A1654CF00D6DD30 /* UIViewController+.swift */; }; 3E9683EE2A16562700D6DD30 /* UIView+.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E9683ED2A16562700D6DD30 /* UIView+.swift */; }; 3E9683F02A1656A800D6DD30 /* SizeLiteral.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E9683EF2A1656A800D6DD30 /* SizeLiteral.swift */; }; - 7E0148BB2A1890530036147D /* MainFeedViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E0148BA2A1890530036147D /* MainFeedViewController.swift */; }; 3EEE765F2A1678E800D0B80E /* UserProfileView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EEE765E2A1678E800D0B80E /* UserProfileView.swift */; }; 3EEE76612A1757D400D0B80E /* NewPostViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EEE76602A1757D400D0B80E /* NewPostViewController.swift */; }; 3EEE76632A175ECD00D0B80E /* BottomMenuContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EEE76622A175ECD00D0B80E /* BottomMenuContentView.swift */; }; @@ -52,6 +53,8 @@ /* End PBXBuildFile section */ /* Begin PBXFileReference section */ + 372AAF722A20E7FC009212A8 /* DMTableviewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DMTableviewCell.swift; sourceTree = ""; }; + 372AAF742A20E808009212A8 /* DMCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DMCollectionViewCell.swift; sourceTree = ""; }; 37C4BF052A1D3E86006FBFF6 /* SF-Pro-Text-Bold.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "SF-Pro-Text-Bold.ttf"; sourceTree = ""; }; 37D49A6D2A17CE5C00FBCA0F /* UIStackView+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIStackView+.swift"; sourceTree = ""; }; 37D49A6F2A18891600FBCA0F /* UITextfield+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UITextfield+.swift"; sourceTree = ""; }; @@ -70,7 +73,6 @@ 3E9683EB2A1654CF00D6DD30 /* UIViewController+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIViewController+.swift"; sourceTree = ""; }; 3E9683ED2A16562700D6DD30 /* UIView+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIView+.swift"; sourceTree = ""; }; 3E9683EF2A1656A800D6DD30 /* SizeLiteral.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SizeLiteral.swift; sourceTree = ""; }; - 7E0148BA2A1890530036147D /* MainFeedViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainFeedViewController.swift; sourceTree = ""; }; 3EEE765E2A1678E800D0B80E /* UserProfileView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserProfileView.swift; sourceTree = ""; }; 3EEE76602A1757D400D0B80E /* NewPostViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NewPostViewController.swift; sourceTree = ""; }; 3EEE76622A175ECD00D0B80E /* BottomMenuContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BottomMenuContentView.swift; sourceTree = ""; }; @@ -111,6 +113,15 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 372AAF702A20E7C8009212A8 /* Cell */ = { + isa = PBXGroup; + children = ( + 372AAF722A20E7FC009212A8 /* DMTableviewCell.swift */, + 372AAF742A20E808009212A8 /* DMCollectionViewCell.swift */, + ); + path = Cell; + sourceTree = ""; + }; 3EEE766B2A17AEC000D0B80E /* NewPostImageCollection */ = { isa = PBXGroup; children = ( @@ -323,6 +334,7 @@ 7E8DF5942A1237120023948F /* DMList */ = { isa = PBXGroup; children = ( + 372AAF702A20E7C8009212A8 /* Cell */, 7E8DF5B32A1239100023948F /* DMList.swift */, ); path = DMList; @@ -434,12 +446,11 @@ 3EEE766F2A17B5D800D0B80E /* CollectionViewAddCellButton.swift in Sources */, 7E8DF59C2A1238770023948F /* EndPoint.swift in Sources */, 7E8DF59E2A12387E0023948F /* Service.swift in Sources */, + 372AAF732A20E7FC009212A8 /* DMTableviewCell.swift in Sources */, 3E6CF47C2A14F63700DC3B2B /* BaseTableViewCell.swift in Sources */, 3E9683F02A1656A800D6DD30 /* SizeLiteral.swift in Sources */, 3E9683EE2A16562700D6DD30 /* UIView+.swift in Sources */, - 7E8DF5AE2A1238F80023948F /* MainFeed.swift in Sources */, 7E0148BB2A1890530036147D /* MainFeedViewController.swift in Sources */, - 7E8DF5732A12306B0023948F /* ViewController.swift in Sources */, 3EEE765F2A1678E800D0B80E /* UserProfileView.swift in Sources */, 3E6CF47A2A14F43500DC3B2B /* BaseViewController.swift in Sources */, 3E9683E42A16319A00D6DD30 /* UIColor+.swift in Sources */, @@ -455,6 +466,7 @@ 7E8DF56F2A12306B0023948F /* AppDelegate.swift in Sources */, 7E8DF5AC2A1238D40023948F /* Font.swift in Sources */, 7E8DF5712A12306B0023948F /* SceneDelegate.swift in Sources */, + 372AAF752A20E808009212A8 /* DMCollectionViewCell.swift in Sources */, 7E8DF5982A12385E0023948F /* Protocol.swift in Sources */, 7E8DF59A2A12386D0023948F /* API.swift in Sources */, 3E9683EC2A1654CF00D6DD30 /* UIViewController+.swift in Sources */, diff --git a/Instagram-iOS/Instagram-iOS/Screens/DMList/Cell/DMCollectionViewCell.swift b/Instagram-iOS/Instagram-iOS/Screens/DMList/Cell/DMCollectionViewCell.swift new file mode 100644 index 0000000..3a5e63f --- /dev/null +++ b/Instagram-iOS/Instagram-iOS/Screens/DMList/Cell/DMCollectionViewCell.swift @@ -0,0 +1,57 @@ +// +// DMCollectionViewCell.swift +// Instagram-iOS +// +// Created by Joon Baek on 2023/05/26. +// + +import UIKit + +import SnapKit + +final class DMCollectionViewCell: BaseCollectionViewCell { + + // MARK: - Property + // MARK: - UI Property + +// let userProfileView = UserProfileView(usedView: .dm, storyStatus: .none) + let userProfileView: UIImageView = { + let image = UIImageView() + image.backgroundColor = .blue + return image + }() + + let usernameLabel: UILabel = { + let label = UILabel() + label.text = "hanyee" + label.font = .detail4 + label.textColor = .gray2 + return label + }() + + + // MARK: - Layout + + override func setLayout() { + addSubview(userProfileView) + userProfileView.snp.makeConstraints { + $0.top.equalToSuperview().offset(10) + $0.leading.equalToSuperview().offset(7) + $0.centerX.equalToSuperview() + } + + addSubview(usernameLabel) + usernameLabel.snp.makeConstraints { + $0.top.equalTo(userProfileView.snp.bottom).offset(10) + $0.centerX.equalTo(userProfileView) + } + } + + override func setStyle() { + + } + + // MARK: - Custom Method + + +} diff --git a/Instagram-iOS/Instagram-iOS/Screens/DMList/Cell/DMTableviewCell.swift b/Instagram-iOS/Instagram-iOS/Screens/DMList/Cell/DMTableviewCell.swift new file mode 100644 index 0000000..0c4fd08 --- /dev/null +++ b/Instagram-iOS/Instagram-iOS/Screens/DMList/Cell/DMTableviewCell.swift @@ -0,0 +1,82 @@ +// +// DMTableviewCell.swift +// Instagram-iOS +// +// Created by Joon Baek on 2023/05/26. +// + +import UIKit + +import SnapKit + +final class DMTableviewCell: BaseTableViewCell { + + // MARK: - Property + // MARK: - UI Property + +// let userProfileView = UserProfileView(usedView: .dm, storyStatus: .none) + private let userProfileView: UIImageView = { + let image = UIImageView() + image.backgroundColor = .blue + return image + }() + + private let usernameLabel: UILabel = { + let label = UILabel() + label.text = "hanyee" + label.font = .detail2 + label.textColor = .gray2 + return label + }() + + private let textMessageLabel: UILabel = { + let label = UILabel() + label.text = "hanyee" + label.font = .detail2kor + label.textColor = .gray2 + return label + }() + + private lazy var starButton: UIButton = { + let button = UIButton() + button.backgroundColor = .yellow + return button + }() + + + // MARK: - Layout + + override func setLayout() { + addSubview(userProfileView) + userProfileView.snp.makeConstraints { + $0.centerY.equalToSuperview() + $0.leading.equalToSuperview().offset(14) + } + + addSubview(usernameLabel) + usernameLabel.snp.makeConstraints { + $0.top.equalToSuperview().offset(21) + $0.leading.equalTo(userProfileView.snp.trailing).offset(10) + } + + addSubview(textMessageLabel) + textMessageLabel.snp.makeConstraints { + $0.top.equalTo(usernameLabel).offset(2) + $0.leading.equalTo(usernameLabel) + } + + addSubview(starButton) + starButton.snp.makeConstraints { + $0.centerY.equalToSuperview() + $0.trailing.equalToSuperview().offset(-9) + } + } + + override func setStyle() { + + } + + // MARK: - Custom Method + + +}