Skip to content

Commit

Permalink
[Feat] CDS-Mobile1#27 - DMCollectionViewCell, DMTableViewCell 구현
Browse files Browse the repository at this point in the history
  • Loading branch information
joonBaek12 committed May 26, 2023
1 parent f25bf14 commit e0a5d19
Show file tree
Hide file tree
Showing 3 changed files with 155 additions and 4 deletions.
20 changes: 16 additions & 4 deletions Instagram-iOS/Instagram-iOS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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 */; };
Expand All @@ -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 */; };
Expand All @@ -52,6 +53,8 @@
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
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>"; };
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 All @@ -70,7 +73,6 @@
3E9683EB2A1654CF00D6DD30 /* UIViewController+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIViewController+.swift"; sourceTree = "<group>"; };
3E9683ED2A16562700D6DD30 /* UIView+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIView+.swift"; sourceTree = "<group>"; };
3E9683EF2A1656A800D6DD30 /* SizeLiteral.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SizeLiteral.swift; sourceTree = "<group>"; };
7E0148BA2A1890530036147D /* MainFeedViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainFeedViewController.swift; sourceTree = "<group>"; };
3EEE765E2A1678E800D0B80E /* UserProfileView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserProfileView.swift; sourceTree = "<group>"; };
3EEE76602A1757D400D0B80E /* NewPostViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NewPostViewController.swift; sourceTree = "<group>"; };
3EEE76622A175ECD00D0B80E /* BottomMenuContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BottomMenuContentView.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -111,6 +113,15 @@
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
372AAF702A20E7C8009212A8 /* Cell */ = {
isa = PBXGroup;
children = (
372AAF722A20E7FC009212A8 /* DMTableviewCell.swift */,
372AAF742A20E808009212A8 /* DMCollectionViewCell.swift */,
);
path = Cell;
sourceTree = "<group>";
};
3EEE766B2A17AEC000D0B80E /* NewPostImageCollection */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -323,6 +334,7 @@
7E8DF5942A1237120023948F /* DMList */ = {
isa = PBXGroup;
children = (
372AAF702A20E7C8009212A8 /* Cell */,
7E8DF5B32A1239100023948F /* DMList.swift */,
);
path = DMList;
Expand Down Expand Up @@ -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 */,
Expand All @@ -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 */,
Expand Down
Original file line number Diff line number Diff line change
@@ -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


}
Original file line number Diff line number Diff line change
@@ -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


}

0 comments on commit e0a5d19

Please sign in to comment.