-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathEmotionOrbCollectionViewCell.swift
More file actions
60 lines (49 loc) · 1.69 KB
/
EmotionOrbCollectionViewCell.swift
File metadata and controls
60 lines (49 loc) · 1.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
//
// EmotionOrbCollectionViewCell.swift
// Presentation
//
// Created by 최정인 on 7/28/25.
//
import SnapKit
import UIKit
final class EmotionOrbCollectionViewCell: UICollectionViewCell {
private enum Layout {
static let emotionOrbImageSize: CGFloat = 96
static let emotionLabelTopSpacing: CGFloat = 6
static let emotionLabelHeight: CGFloat = 24
}
private let emotionOrbImage = UIImageView()
private let emotionLabel = UILabel()
override init(frame: CGRect) {
super.init(frame: frame)
configureAttribute()
configureLayout()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
private func configureAttribute() {
emotionLabel.text = ""
emotionLabel.textAlignment = .center
emotionLabel.font = BitnagilFont(style: .body1, weight: .regular).font
emotionLabel.textColor = BitnagilColor.gray20
}
private func configureLayout() {
contentView.addSubview(emotionOrbImage)
contentView.addSubview(emotionLabel)
emotionOrbImage.snp.makeConstraints { make in
make.top.equalToSuperview()
make.horizontalEdges.equalToSuperview()
make.size.equalTo(Layout.emotionOrbImageSize)
}
emotionLabel.snp.makeConstraints { make in
make.top.equalTo(emotionOrbImage.snp.bottom).offset(Layout.emotionLabelTopSpacing)
make.horizontalEdges.equalToSuperview()
make.height.equalTo(Layout.emotionLabelHeight)
}
}
func configureCell(emotion: EmotionType) {
emotionOrbImage.image = emotion.image
emotionLabel.text = emotion.title
}
}