Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
@@ -1,17 +1,17 @@
{
"images" : [
{
"filename" : "chevron_right_icon@1x.png",
"filename" : "asterisk_icon@1x.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "chevron_right_icon@2x.png",
"filename" : "asterisk_icon@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "chevron_right_icon@3x.png",
"filename" : "asterisk_icon@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
Expand Down
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.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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" : "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.
132 changes: 132 additions & 0 deletions Projects/Presentation/Sources/Common/Component/TooltipView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
//
// ToolTipView.swift
// Presentation
//
// Created by 이동현 on 7/20/25.
//

import SnapKit
import UIKit

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
}

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
completion?()
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,15 @@ 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 deleteIcon = UIImage(named: "delete_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)
}

enum Direction {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ final class MypageTableViewCell: UITableViewCell {
private enum Layout {
static let titleLableLeadingSpacing: CGFloat = 20
static let titleLableTrailingSpacing: CGFloat = 8
static let chevronImageViewTrailingSpacing: CGFloat = 6
static let chevronImageViewSize: CGFloat = 36
static let chevronImageViewTrailingSpacing: CGFloat = 16
static let chevronImageViewSize: CGFloat = 16
}

private let titleLabel = UILabel()
Expand All @@ -36,7 +36,10 @@ final class MypageTableViewCell: UITableViewCell {
private func configureAttribute() {
titleLabel.font = BitnagilFont(style: .body1, weight: .regular).font

chevronImageView.image = BitnagilIcon.chevronRightIcon
chevronImageView.tintColor = .black
chevronImageView.image = BitnagilIcon
.chevronIcon(direction: .right)?
.withRenderingMode(.alwaysTemplate)
}

private func configureLayout() {
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