Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
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
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
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
134 changes: 134 additions & 0 deletions Projects/Presentation/Sources/Common/Component/TooltipView.swift
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
Comment thread
taipaise marked this conversation as resolved.
Outdated

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
}
}
Comment thread
taipaise marked this conversation as resolved.
}
Original file line number Diff line number Diff line change
Expand Up @@ -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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

여기서 infoIcon은 현재 informaitonIcon과 중복이 될 것 같아요 !!!

흠 그리고 ... 약간 고민 + 궁굼한 부분이 몇개 있어요 !!

  • asteriskIcon를 왜 이미지로 빼셨는지 !! > 피그마 상에는 Label로 처리해도 됐었을 것 같긴합니다 !!!
  • chevronIcon도 사실 전 하나의 이미지 파일만 포함한 채, chevronIcon(direction: Direction) 함수를 통해서 방향을 바꿀 수 있을 것이라고 생각해서 구현해두었는데 !!
    띵의 입장에서는 chevronDownIcon, chevronRightIcon 등 방향에 각각 맞는 아이콘이 있는게 맞다고 생각하시나요 ?
  • routineCreationIcon도 plusIcon과 동일하다고 생각하긴 하는데 어찌 생각하시나요 ?
  • uncheckedIcon와 checkedIcon를 이미지로 뺀 이유도 궁금합니다 !!! > 만약 저였다면 체크 아이콘만 존재시키고 View로 구현해서 toggle 값에 따라 아이콘, 배경색을 바꾸면서 구현할 것 같아서 여쭤봅니다아 !!

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

  1. information icon은 중복 수정하겠습니다~!

  2. asterisk가 피그마에 보시면 label에 표시되는 글보다 살~짝 위에 표시되어 있습니다. 처음에는 한 개의 label안에서 일반 text + attributed text로 처리하려했는데요, 앞서 말씀드린 이유로 '*' 를 이미지로 따로 빼서 처리하고자 했습니다. 다만 조이 말씀을 듣고 보니 그냥 UILabel 두 개로 처리하면 되는 문제였네요.!.! 혹시 이 부분은 이대로 가져가도 될까요?

  3. chevronIcon 자체를 회전 시켜서 사용하겠다는 말씀이신가요? 꺾인 각도와, 선의 길이가 모두 같으면 이미지 하나로 direction을 부여해서 처리하는 방식도 좋은 것 같습니다.

  4. 홈 화면에서 사용되는 + 아이콘 말씀이시라면, 굵기가 미세하게 다릅니다! 홈 화면의 + 아이콘은 2px, 루틴 생성의 + 아이콘은 1.4px로 차이가 있어서 새로운 asset을 추가했습니다!

  5. 체크 아이콘만 넣어두고, unchecked 시에는 cornerRadius 값과 배경색으로 구현할 수 있지만, 구현의 편의성을 위해 checked 아이콘을 asset에 추가했습니다!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

  1. 확인 !!!!!!!!!!!
  2. 화긴 !!! 일단 노메러 ~~~ (추후 시간 많을때 수정 ...... .. 데스노트에 적어두겟슴)
  3. 이것도 일단 내비두고 ~ 같이 췍 해보고 ... 같으면 direction하는것으로 !!!
  4. 헐 굵기 차이 확인 레존드다 ....
  5. 이것두 화긴 ~~ 사실 ~ 일단 개발이 급하니까 ....... 이미지도 accept !!!!
    하지만 추후 리팩토링의 기회가 주어진다며는 ... 이것도 같이 고민해보는것이 어떠신지 !!!

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

죠습니다!! 마크2에서 고려하고 수정하는 걸로~!

}

enum Direction {
Expand Down
35 changes: 35 additions & 0 deletions Projects/Presentation/Sources/RoutineCreation/Model/Week.swift
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:
"일"
}
}
}
Loading
Loading