Skip to content

Commit 62d6638

Browse files
committed
[BOOK-358] feat: 뱃지뷰 추가
1 parent f311dac commit 62d6638

2 files changed

Lines changed: 47 additions & 0 deletions

File tree

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
// Copyright © 2025 Booket. All rights reserved
2+
3+
import BKDesign
4+
import SnapKit
5+
import UIKit
6+
7+
final class BadgeView: UIView {
8+
private let label = BKLabel(
9+
fontStyle: .caption1(weight: .medium),
10+
color: .bkContentColor(.brand),
11+
alignment: .center
12+
)
13+
14+
public var title: String {
15+
didSet {
16+
label.setText(text: title)
17+
}
18+
}
19+
20+
public init(title: String) {
21+
self.title = title
22+
super.init(frame: .zero)
23+
24+
setupUI()
25+
setupLayout()
26+
}
27+
28+
required init?(coder: NSCoder) {
29+
fatalError("init(coder:) has not been implemented")
30+
}
31+
32+
private func setupUI() {
33+
self.backgroundColor = .bkBackgroundColor(.tertiary)
34+
self.layer.cornerRadius = BKRadius.xsmall
35+
label.setText(text: title)
36+
}
37+
38+
private func setupLayout() {
39+
addSubview(label)
40+
41+
label.snp.makeConstraints {
42+
$0.leading.trailing.equalToSuperview().inset(BKSpacing.spacing2)
43+
$0.top.bottom.equalToSuperview().inset(BKSpacing.spacing05)
44+
}
45+
}
46+
}

src/Projects/BKPresentation/Sources/MainFlow/Note/View/TooltipView.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import BKDesign
44
import UIKit
55
import SnapKit
66

7+
// 2차 작업 때, BKDesign component로 빼기
78
final class TooltipView: BaseView {
89
private let textLabel = BKLabel(
910
text: "예시 문장을 알려드려요",

0 commit comments

Comments
 (0)