-
Notifications
You must be signed in to change notification settings - Fork 1
[Feat-T3-110] 루틴 생성 화면 구현 #25
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
Changes from 7 commits
8b6f0ff
5d2a781
7eb32f1
76afd6a
49c38a4
ab8687e
bbbe0f7
286a35d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| { | ||
| "images" : [ | ||
| { | ||
| "filename" : "asterisk_icon@1x.png", | ||
| "idiom" : "universal", | ||
| "scale" : "1x" | ||
| }, | ||
| { | ||
| "filename" : "asterisk_icon@2x.png", | ||
| "idiom" : "universal", | ||
| "scale" : "2x" | ||
| }, | ||
| { | ||
| "filename" : "asterisk_icon@3x.png", | ||
| "idiom" : "universal", | ||
| "scale" : "3x" | ||
| } | ||
| ], | ||
| "info" : { | ||
| "author" : "xcode", | ||
| "version" : 1 | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| { | ||
| "images" : [ | ||
| { | ||
| "filename" : "checked_icon@1x.png", | ||
| "idiom" : "universal", | ||
| "scale" : "1x" | ||
| }, | ||
| { | ||
| "filename" : "checked_icon@2x.png", | ||
| "idiom" : "universal", | ||
| "scale" : "2x" | ||
| }, | ||
| { | ||
| "filename" : "checked_icon@3x.png", | ||
| "idiom" : "universal", | ||
| "scale" : "3x" | ||
| } | ||
| ], | ||
| "info" : { | ||
| "author" : "xcode", | ||
| "version" : 1 | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| { | ||
| "images" : [ | ||
| { | ||
| "filename" : "chevron_down_icon@1x.png", | ||
| "idiom" : "universal", | ||
| "scale" : "1x" | ||
| }, | ||
| { | ||
| "filename" : "chevron_down_icon@2x.png", | ||
| "idiom" : "universal", | ||
| "scale" : "2x" | ||
| }, | ||
| { | ||
| "filename" : "chevron_down_icon@3x.png", | ||
| "idiom" : "universal", | ||
| "scale" : "3x" | ||
| } | ||
| ], | ||
| "info" : { | ||
| "author" : "xcode", | ||
| "version" : 1 | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| { | ||
| "images" : [ | ||
| { | ||
| "filename" : "delete_icon@1x.png", | ||
| "idiom" : "universal", | ||
| "scale" : "1x" | ||
| }, | ||
| { | ||
| "filename" : "delete_icon@2x.png", | ||
| "idiom" : "universal", | ||
| "scale" : "2x" | ||
| }, | ||
| { | ||
| "filename" : "delete_icon@3x.png", | ||
| "idiom" : "universal", | ||
| "scale" : "3x" | ||
| } | ||
| ], | ||
| "info" : { | ||
| "author" : "xcode", | ||
| "version" : 1 | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| { | ||
| "images" : [ | ||
| { | ||
| "filename" : "info_icon@1x.png", | ||
| "idiom" : "universal", | ||
| "scale" : "1x" | ||
| }, | ||
| { | ||
| "filename" : "info_icon@2x.png", | ||
| "idiom" : "universal", | ||
| "scale" : "2x" | ||
| }, | ||
| { | ||
| "filename" : "info_icon@3x.png", | ||
| "idiom" : "universal", | ||
| "scale" : "3x" | ||
| } | ||
| ], | ||
| "info" : { | ||
| "author" : "xcode", | ||
| "version" : 1 | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| { | ||
| "images" : [ | ||
| { | ||
| "filename" : "routine_creation_icon@1x.png", | ||
| "idiom" : "universal", | ||
| "scale" : "1x" | ||
| }, | ||
| { | ||
| "filename" : "routine_creation_icon@2x.png", | ||
| "idiom" : "universal", | ||
| "scale" : "2x" | ||
| }, | ||
| { | ||
| "filename" : "routine_creation_icon@3x.png", | ||
| "idiom" : "universal", | ||
| "scale" : "3x" | ||
| } | ||
| ], | ||
| "info" : { | ||
| "author" : "xcode", | ||
| "version" : 1 | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| { | ||
| "images" : [ | ||
| { | ||
| "filename" : "unchecked_icon@1x.png", | ||
| "idiom" : "universal", | ||
| "scale" : "1x" | ||
| }, | ||
| { | ||
| "filename" : "unchecked_icon@2x.png", | ||
| "idiom" : "universal", | ||
| "scale" : "2x" | ||
| }, | ||
| { | ||
| "filename" : "unchecked_icon@3x.png", | ||
| "idiom" : "universal", | ||
| "scale" : "3x" | ||
| } | ||
| ], | ||
| "info" : { | ||
| "author" : "xcode", | ||
| "version" : 1 | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,134 @@ | ||
| // | ||
| // ToolTipView.swift | ||
| // Presentation | ||
| // | ||
| // Created by 이동현 on 7/20/25. | ||
| // | ||
|
|
||
| import UIKit | ||
| import SnapKit | ||
|
|
||
| final class TooltipView: UIView { | ||
| enum TooltipTailPosition { | ||
| case center | ||
| case offsetFromLeading(CGFloat) | ||
| } | ||
|
|
||
| private enum Layout { | ||
| static let backgroundViewBottomInset: CGFloat = 8 | ||
| static let messageLabelInset: CGFloat = 10 | ||
| static let tailWidth: CGFloat = 14 | ||
| static let tailHeight: CGFloat = 8 | ||
| static let cornerRadius: CGFloat = 8 | ||
| } | ||
|
|
||
| private let backgroundView = UIView() | ||
| private let messageLabel = UILabel() | ||
| private let tailLayer = CAShapeLayer() | ||
| private let tailPosition: TooltipTailPosition | ||
|
|
||
| init(tailPosition: TooltipTailPosition) { | ||
| self.tailPosition = tailPosition | ||
| super.init(frame: .zero) | ||
| configureAttribute() | ||
| configureLayout() | ||
| } | ||
|
|
||
| required init?(coder: NSCoder) { | ||
| fatalError("init(coder:) has not been implemented") | ||
| } | ||
|
|
||
| override func layoutSubviews() { | ||
| super.layoutSubviews() | ||
| generateTail() | ||
| } | ||
|
|
||
| private func configureAttribute() { | ||
| backgroundView.backgroundColor = BitnagilColor.navy400 | ||
| backgroundView.layer.cornerRadius = Layout.cornerRadius | ||
| messageLabel.textColor = .white | ||
| messageLabel.font = BitnagilFont | ||
| .init(style: .caption1, weight: .medium) | ||
| .font | ||
| .withSize(12) | ||
| } | ||
|
|
||
| private func configureLayout() { | ||
| addSubview(backgroundView) | ||
| backgroundView.addSubview(messageLabel) | ||
|
|
||
| backgroundView.snp.makeConstraints { make in | ||
| make.top.horizontalEdges.equalToSuperview() | ||
| make.bottom.equalToSuperview().inset(Layout.backgroundViewBottomInset) | ||
| } | ||
|
|
||
| messageLabel.snp.makeConstraints { make in | ||
| make.edges.equalToSuperview().inset(Layout.messageLabelInset) | ||
| } | ||
| } | ||
|
|
||
| func configure(message: String) { | ||
| messageLabel.text = message | ||
| } | ||
|
|
||
| private func generateTail() { | ||
| let startX: CGFloat | ||
| let width = Layout.tailWidth | ||
| let height = Layout.tailHeight | ||
| let y = bounds.height - height | ||
|
|
||
| switch tailPosition { | ||
| case .center: | ||
| startX = (backgroundView.bounds.width - width) / 2 | ||
| case .offsetFromLeading(let offset): | ||
| startX = offset | ||
| } | ||
|
|
||
| let path = UIBezierPath() | ||
| path.move(to: CGPoint(x: startX, y: y)) | ||
| path.addQuadCurve( | ||
| to: CGPoint(x: startX + width, y: y), | ||
| controlPoint: CGPoint(x: startX + width / 2, y: y + height * 1.5)) | ||
| path.addLine(to: CGPoint(x: startX + width, y: y)) | ||
| path.close() | ||
|
|
||
| tailLayer.path = path.cgPath | ||
| tailLayer.fillColor = backgroundView.backgroundColor?.cgColor | ||
|
|
||
| if tailLayer.superlayer == nil { | ||
| layer.addSublayer(tailLayer) | ||
| } | ||
| } | ||
|
|
||
| func showTooltip() { | ||
| self.alpha = 0 | ||
| self.transform = CGAffineTransform(scaleX: 0.7, y: 0.7) | ||
| self.isHidden = false | ||
|
|
||
| UIView.animate( | ||
| withDuration: 0.2, | ||
| delay: 0, | ||
| usingSpringWithDamping: 1, | ||
| initialSpringVelocity: 1, | ||
| options: [.curveEaseOut], | ||
| animations: { | ||
| self.alpha = 1 | ||
| self.transform = .identity | ||
| }, | ||
| completion: nil) | ||
| } | ||
|
|
||
| func hideTooltip(completion: (() -> Void)? = nil) { | ||
| UIView.animate( | ||
| withDuration: 0.15, | ||
| delay: 0, | ||
| options: [.curveEaseIn], | ||
| animations: { | ||
| self.alpha = 0 | ||
| self.transform = CGAffineTransform(scaleX: 0.7, y: 0.7) | ||
| }) { _ in | ||
| self.isHidden = true | ||
| self.transform = .identity | ||
| } | ||
| } | ||
|
taipaise marked this conversation as resolved.
|
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -37,9 +37,18 @@ enum BitnagilIcon { | |
| static let mypageFillIcon = UIImage(named: "mypage_fill_icon", in: bundle, with: nil) | ||
| static let mypageEmptyIcon = UIImage(named: "mypage_empty_icon", in: bundle, with: nil) | ||
|
|
||
| // MARK: - Mypage Icons | ||
| static let settingIcon = UIImage(named: "setting_icon", in: bundle, with: nil) | ||
|
|
||
| static let chevronRightIcon = UIImage(named: "chevron_right_icon", in: bundle, with: nil) | ||
|
|
||
| // MARK: - Routine Creation Icons | ||
| static let asteriskIcon = UIImage(named: "asterisk_icon", in: bundle, with: nil) | ||
| static let chevronDownIcon = UIImage(named: "chevron_down_icon", in: bundle, with: nil) | ||
| static let deleteIcon = UIImage(named: "delete_icon", in: bundle, with: nil) | ||
| static let infoIcon = UIImage(named: "info_icon", in: bundle, with: nil) | ||
| static let uncheckedIcon = UIImage(named: "unchecked_icon", in: bundle, with: nil) | ||
| static let checkedIcon = UIImage(named: "checked_icon", in: bundle, with: nil) | ||
| static let routineCreationIcon = UIImage(named: "routine_creation_icon", in: bundle, with: nil) | ||
|
Comment on lines
+45
to
+48
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 여기서 infoIcon은 현재 informaitonIcon과 중복이 될 것 같아요 !!! 흠 그리고 ... 약간 고민 + 궁굼한 부분이 몇개 있어요 !!
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 죠습니다!! 마크2에서 고려하고 수정하는 걸로~! |
||
| } | ||
|
|
||
| enum Direction { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| // | ||
| // Week.swift | ||
| // Presentation | ||
| // | ||
| // Created by 이동현 on 7/21/25. | ||
| // | ||
|
|
||
| enum Week: Int, CaseIterable { | ||
| case monday | ||
| case tuesday | ||
| case wednesday | ||
| case thursday | ||
| case friday | ||
| case saturday | ||
| case sunday | ||
|
|
||
| var koreanValue: String { | ||
| switch self { | ||
| case .monday: | ||
| "월" | ||
| case .tuesday: | ||
| "화" | ||
| case .wednesday: | ||
| "수" | ||
| case .thursday: | ||
| "목" | ||
| case .friday: | ||
| "금" | ||
| case .saturday: | ||
| "토" | ||
| case .sunday: | ||
| "일" | ||
| } | ||
| } | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.