Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix [#36] 목표 시간 설정뷰 #69

Merged
merged 2 commits into from
Jan 13, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions HMH_iOS/HMH_iOS/Global/Literals/String/String.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ enum StringLiteral {
static var backgroundViewId = "GrayBackground"
static var appAddFooterViewID = "appAddFooter"
}

enum Time {
static var timeLabel = "시간"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

p4. hour은 혹싀 어떠신지,, ㅋ

static var minLabel = "분"
}
}

enum myPage {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,18 @@ import FamilyControls
class GoalTimeSelectView: UIView {

var screenTime = ScreenTime.shared
private let picker = SpecificTimePickerView()
private let timePicker = HMHTimePickerView(type: .specificTime)
private let timeLable = UILabel().then {
$0.text = StringLiteral.Challenge.Time.timeLabel
$0.font = .iosText2Medium20
$0.textColor = .gray2
}
private let minPicker = HMHTimePickerView(type: .specificMinute)
private let minLable = UILabel().then {
$0.text = StringLiteral.Challenge.Time.minLabel
$0.font = .iosText2Medium20
$0.textColor = .gray2
}

override init(frame: CGRect) {
super.init(frame: frame)
Expand All @@ -33,13 +44,30 @@ class GoalTimeSelectView: UIView {
}

private func setHierarchy() {
self.addSubviews(picker)
self.addSubviews(timePicker,timeLable,minPicker,minLable)
}

private func setConstraints() {
picker.snp.makeConstraints {
$0.center.equalToSuperview()
$0.width.equalTo(335.adjusted)
timePicker.snp.makeConstraints {
$0.centerY.equalToSuperview()
$0.leading.equalToSuperview().offset(72.adjusted)
$0.width.equalTo(67.adjusted)
}

timeLable.snp.makeConstraints {
$0.centerY.equalToSuperview()
$0.leading.equalTo(timePicker.snp.trailing).offset(-7.adjusted)
}

minPicker.snp.makeConstraints {
$0.centerY.equalToSuperview()
$0.leading.equalTo(timeLable.snp.trailing).offset(23.adjusted)
$0.width.equalTo(67.adjusted)
}

minLable.snp.makeConstraints {
$0.centerY.equalToSuperview()
$0.leading.equalTo(minPicker.snp.trailing).offset(2.adjusted)
}
}

Expand Down