forked from CDS-Mobile1/CDS_iOS
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Feat] CDS-Mobile1#27 - DMCollectionViewCell, DMTableViewCell 구현
- Loading branch information
1 parent
f25bf14
commit e0a5d19
Showing
3 changed files
with
155 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
Instagram-iOS/Instagram-iOS/Screens/DMList/Cell/DMCollectionViewCell.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
||
|
||
} |
82 changes: 82 additions & 0 deletions
82
Instagram-iOS/Instagram-iOS/Screens/DMList/Cell/DMTableviewCell.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
||
|
||
} |