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
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "exclamation_filled_icon@1x.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "exclamation_filled_icon@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "exclamation_filled_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,44 @@
//
// MyPageTableViewCell.swift
// Presentation
//
// Created by 이동현 on 7/17/25.
//

import SnapKit
import UIKit

class BitnagilBaseTableViewCell: UITableViewCell {
private enum Layout {
static let titleLableLeadingSpacing: CGFloat = 20
}

private let titleLabel = UILabel()

override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
configureAttribute()
configureLayout()
}

required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}

func configure(title: String) {
titleLabel.text = title
}

func configureAttribute() {
titleLabel.font = BitnagilFont(style: .body1, weight: .regular).font
}

func configureLayout() {
contentView.addSubview(titleLabel)

titleLabel.snp.makeConstraints { make in
make.verticalEdges.equalToSuperview()
make.leading.equalToSuperview().offset(Layout.titleLableLeadingSpacing)
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
//
// BitnagilButtonTableViewCell.swift
// Presentation
//
// Created by 이동현 on 7/30/25.
//

import SnapKit
import UIKit

protocol BitnagilButtonTableViewCellDelegate: AnyObject {
func bitnagilButtonTableViewCellDidTapButton(_ sender: BitnagilButtonTableViewCell)
}

final class BitnagilButtonTableViewCell: BitnagilBaseTableViewCell {
private enum Layout {
static let buttonTrailingSpacing: CGFloat = 20
static let buttonHeight: CGFloat = 30
static let buttonPadding: CGFloat = 10
static let buttonCornerRadius: CGFloat = 4
}

private let button = UIButton()
private var buttonWidthConstraint: Constraint?
weak var delegate: BitnagilButtonTableViewCellDelegate?

override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
}

required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}

func configure(
title: String,
buttonTitle: String,
isButtonEnabled: Bool
) {
super.configure(title: title)

let font = BitnagilFont.init(style: .body2, weight: .semiBold).font
let textAttribute = [NSAttributedString.Key.font: font]
let textWidth = (buttonTitle as NSString).size(withAttributes: textAttribute).width
let buttonWidth = textWidth + Layout.buttonPadding * 2

buttonWidthConstraint?.update(offset: buttonWidth)
button.setTitle(buttonTitle, for: .normal)
button.isEnabled = isButtonEnabled

if isButtonEnabled {
button.backgroundColor = BitnagilColor.lightBlue100
button.setTitleColor(BitnagilColor.navy500, for: .normal)
} else {
button.backgroundColor = BitnagilColor.gray98
button.setTitleColor(BitnagilColor.gray70, for: .disabled)
}
}

override func configureAttribute() {
super.configureAttribute()

button.titleLabel?.font = BitnagilFont.init(style: .body2, weight: .semiBold).font
button.layer.cornerRadius = Layout.buttonCornerRadius
button.addAction(
UIAction { [weak self] _ in
guard let self else { return }
self.delegate?.bitnagilButtonTableViewCellDidTapButton(self)
},
for: .touchUpInside)
}

override func configureLayout() {
super.configureLayout()

contentView.addSubview(button)

button.snp.makeConstraints { make in
make.centerY.equalToSuperview()
make.trailing.equalToSuperview().inset(Layout.buttonTrailingSpacing)
make.height.equalTo(Layout.buttonHeight)
buttonWidthConstraint = make.width
.equalTo(Layout.buttonPadding)
.constraint
}
}
}
Original file line number Diff line number Diff line change
@@ -1,61 +1,47 @@
//
// MyPageTableViewCell.swift
// BitnagilChevronTableViewCell.swift
// Presentation
//
// Created by 이동현 on 7/17/25.
// Created by 이동현 on 7/30/25.
//

import SnapKit
import UIKit

final class MypageTableViewCell: UITableViewCell {
final class BitnagilChevronTableViewCell: BitnagilBaseTableViewCell {
private enum Layout {
static let titleLableLeadingSpacing: CGFloat = 20
static let titleLableTrailingSpacing: CGFloat = 8
static let chevronImageViewTrailingSpacing: CGFloat = 16
static let chevronImageViewSize: CGFloat = 16
}

private let titleLabel = UILabel()
private let chevronImageView = UIImageView()

override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
configureAttribute()
configureLayout()
}

required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}

func configure(title: String) {
titleLabel.text = title
}

private func configureAttribute() {
titleLabel.font = BitnagilFont(style: .body1, weight: .regular).font
override func configureAttribute() {
super.configureAttribute()

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

private func configureLayout() {
contentView.addSubview(titleLabel)
override func configureLayout() {
super.configureLayout()

contentView.addSubview(chevronImageView)

chevronImageView.snp.makeConstraints { make in
make.centerY.equalToSuperview()
make.trailing.equalToSuperview().inset(Layout.chevronImageViewTrailingSpacing)
make.size.equalTo(Layout.chevronImageViewSize)
}

titleLabel.snp.makeConstraints { make in
make.verticalEdges.equalToSuperview()
make.leading.equalToSuperview().offset(Layout.titleLableLeadingSpacing)
make.trailing.equalTo(chevronImageView.snp.leading).offset(-Layout.titleLableTrailingSpacing)
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
//
// BitnagilToggleTableViewCell.swift
// Presentation
//
// Created by 이동현 on 7/30/25.
//

import SnapKit
import UIKit

protocol BitnagilToggleTableViewCellDelegate: AnyObject {
func bitnagilToggleTableViewCellDidToggle(_ sender: BitnagilToggleTableViewCell, isOn: Bool)
}

final class BitnagilToggleTableViewCell: BitnagilBaseTableViewCell {
private enum Layout {
static let switchTrailingSpacing: CGFloat = 20
static let switchHeight: CGFloat = 24
static let switchWidth: CGFloat = 44
}

private let toggleSwitch = UISwitch()
weak var delegate: BitnagilToggleTableViewCellDelegate?

override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
}

required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}

override func configureAttribute() {
super.configureAttribute()

toggleSwitch.onTintColor = BitnagilColor.navy500
toggleSwitch.tintColor = BitnagilColor.gray95
toggleSwitch.addAction(UIAction { [weak self] action in
guard let self = self else { return }
self.delegate?.bitnagilToggleTableViewCellDidToggle(self, isOn: toggleSwitch.isOn)
}, for: .valueChanged)
}

override func configureLayout() {
super.configureLayout()

contentView.addSubview(toggleSwitch)

toggleSwitch.snp.makeConstraints { make in
make.centerY.equalToSuperview()
make.trailing.equalToSuperview().inset(Layout.switchTrailingSpacing)
make.height.equalTo(Layout.switchHeight)
make.width.equalTo(Layout.switchWidth)
}
}

func configureToggleState(isOn: Bool) {
toggleSwitch.isOn = isOn
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ enum BitnagilIcon {

// MARK: - Mypage Icons
static let settingIcon = UIImage(named: "setting_icon", in: bundle, with: nil)

static let exclamationFilledIcon = UIImage(named: "exclamation_filled_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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ import UIKit
extension UIViewController {
// MARK: - NavigationBar
func configureNavigationBar(navigationStyle: NavigationBarStyle) {
let appearance = UINavigationBarAppearance()
appearance.backgroundEffect = .none
appearance.configureWithOpaqueBackground()
appearance.shadowColor = .clear
navigationController?.navigationBar.standardAppearance = appearance
navigationController?.navigationBar.scrollEdgeAppearance = appearance

switch navigationStyle {
case .hidden:
navigationController?.setNavigationBarHidden(true, animated: false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,9 @@ public struct PresentationDependencyAssembler: DependencyAssemblerProtocol {

return ResultRecommendedRoutineViewModel(resultRecommendedRoutineUseCase: resultRecommendedRoutineUseCase)
}

DIContainer.shared.register(type: SettingViewModel.self) { _ in
return SettingViewModel()
}
}
}
Loading
Loading