diff --git a/iBox/Sources/Base/BaseViewController.swift b/iBox/Sources/Base/BaseViewController.swift index 48ab64b..49548d7 100644 --- a/iBox/Sources/Base/BaseViewController.swift +++ b/iBox/Sources/Base/BaseViewController.swift @@ -25,7 +25,7 @@ class BaseViewController: UIViewController { let backgroundColor: UIColor = .backgroundColor let tintColor: UIColor = .label - let titleFont: UIFont = .systemFont(ofSize: 20, weight: .semibold) + let titleFont: UIFont = .titleFont // MARK: - UI Components @@ -34,16 +34,16 @@ class BaseViewController: UIViewController { let navigationBar = NavigationBar().then { $0.backButton.configuration = .plain() $0.backButton.configuration?.image = UIImage(systemName: "chevron.left") - $0.backButton.configuration?.preferredSymbolConfigurationForImage = .init(weight: .bold) + $0.backButton.configuration?.preferredSymbolConfigurationForImage = .init(weight: .semibold) $0.addButton.configuration = .plain() $0.addButton.configuration?.image = UIImage(systemName: "plus") - $0.addButton.configuration?.preferredSymbolConfigurationForImage = .init(weight: .bold) + $0.addButton.configuration?.preferredSymbolConfigurationForImage = .init(weight: .semibold) $0.moreButton.configuration = .plain() $0.moreButton.configuration?.image = UIImage(systemName: "ellipsis.circle") - $0.moreButton.configuration?.preferredSymbolConfigurationForImage = .init(weight: .bold) + $0.moreButton.configuration?.preferredSymbolConfigurationForImage = .init(weight: .semibold) $0.doneButton.configuration = .plain() $0.doneButton.configuration?.baseForegroundColor = .label - $0.doneButton.configuration?.attributedTitle = AttributedString("완료", attributes: AttributeContainer([NSAttributedString.Key.font: UIFont.systemFont(ofSize: 18, weight: .semibold)])) + $0.doneButton.configuration?.attributedTitle = AttributedString("완료", attributes: AttributeContainer([NSAttributedString.Key.font: UIFont.semiboldLabelFont])) } let contentView: UIView = View() diff --git a/iBox/Sources/BoxList/AddBookmark/AddBookmarkView.swift b/iBox/Sources/BoxList/AddBookmark/AddBookmarkView.swift index d042b30..9bc6fd1 100644 --- a/iBox/Sources/BoxList/AddBookmark/AddBookmarkView.swift +++ b/iBox/Sources/BoxList/AddBookmark/AddBookmarkView.swift @@ -30,7 +30,7 @@ class AddBookmarkView: UIView { private let nameTextViewPlaceHolder = UILabel().then { $0.text = "북마크 이름" - $0.font = UIFont.systemFont(ofSize: 18) + $0.font = .cellTitleFont $0.textColor = .systemGray3 } @@ -38,7 +38,7 @@ class AddBookmarkView: UIView { $0.backgroundColor = .clear $0.layer.borderWidth = 0 $0.textContainerInset = UIEdgeInsets(top: 7, left: 0, bottom: 0, right: 0) - $0.font = UIFont.systemFont(ofSize: 16) + $0.font = .cellTitleFont $0.textColor = .label $0.isScrollEnabled = true } @@ -49,7 +49,7 @@ class AddBookmarkView: UIView { private let urlTextViewPlaceHolder = UILabel().then { $0.text = "URL" - $0.font = UIFont.systemFont(ofSize: 18) + $0.font = .cellTitleFont $0.textColor = .systemGray3 } @@ -57,7 +57,7 @@ class AddBookmarkView: UIView { $0.backgroundColor = .clear $0.layer.borderWidth = 0 $0.textContainerInset = UIEdgeInsets(top: 7, left: 0, bottom: 0, right: 0) - $0.font = UIFont.systemFont(ofSize: 16) + $0.font = .cellTitleFont $0.textColor = .label $0.isScrollEnabled = true } @@ -66,18 +66,18 @@ class AddBookmarkView: UIView { $0.backgroundColor = UIColor.backgroundColor $0.layer.cornerRadius = 10 $0.clipsToBounds = true - $0.titleLabel?.font = UIFont.boldSystemFont(ofSize: 16) + $0.titleLabel?.font = .cellTitleFont $0.isEnabled = true } private let buttonLabel = UILabel().then { $0.text = "목록" - $0.font = UIFont.systemFont(ofSize: 17) + $0.font = .cellTitleFont $0.textColor = .label } let selectedFolderLabel = UILabel().then { - $0.font = UIFont.systemFont(ofSize: 17) + $0.font = .descriptionFont $0.textColor = .systemGray $0.textAlignment = .right } diff --git a/iBox/Sources/BoxList/AddBookmark/AddBookmarkViewController.swift b/iBox/Sources/BoxList/AddBookmark/AddBookmarkViewController.swift index 5412425..07e46bb 100644 --- a/iBox/Sources/BoxList/AddBookmark/AddBookmarkViewController.swift +++ b/iBox/Sources/BoxList/AddBookmark/AddBookmarkViewController.swift @@ -45,7 +45,7 @@ final class AddBookmarkViewController: UIViewController { navigationItem.rightBarButtonItem?.isEnabled = false let attributes: [NSAttributedString.Key: Any] = [ - .font: UIFont.boldSystemFont(ofSize: 17) + .font: UIFont.semiboldLabelFont ] navigationItem.leftBarButtonItem?.setTitleTextAttributes(attributes, for: .normal) diff --git a/iBox/Sources/BoxList/AddBookmark/FolderListCell.swift b/iBox/Sources/BoxList/AddBookmark/FolderListCell.swift index c955d35..e77e200 100644 --- a/iBox/Sources/BoxList/AddBookmark/FolderListCell.swift +++ b/iBox/Sources/BoxList/AddBookmark/FolderListCell.swift @@ -21,7 +21,7 @@ class FolderListCell: UITableViewCell { let folderNameLabel = UILabel().then { $0.textColor = .label - $0.font = .systemFont(ofSize: 17, weight: .regular) + $0.font = .cellTitleFont } private let checkImageView = UIImageView().then { diff --git a/iBox/Sources/BoxList/AddBookmark/FolderListView.swift b/iBox/Sources/BoxList/AddBookmark/FolderListView.swift index e325ffd..9bc0aad 100644 --- a/iBox/Sources/BoxList/AddBookmark/FolderListView.swift +++ b/iBox/Sources/BoxList/AddBookmark/FolderListView.swift @@ -17,7 +17,7 @@ class FolderListView: UIView { private let infoLabel = UILabel().then { $0.text = "새로운 북마크를 추가할 폴더를 선택해주세요." - $0.font = UIFont.boldSystemFont(ofSize: 17) + $0.font = .semiboldLabelFont $0.textColor = .label $0.textAlignment = .center } diff --git a/iBox/Sources/BoxList/BoxListCell.swift b/iBox/Sources/BoxList/BoxListCell.swift index 2c72874..a52416d 100644 --- a/iBox/Sources/BoxList/BoxListCell.swift +++ b/iBox/Sources/BoxList/BoxListCell.swift @@ -24,7 +24,9 @@ class BoxListCell: UITableViewCell { $0.contentMode = .scaleAspectFit } - private let label = UILabel() + private let label = UILabel().then { + $0.font = .cellTitleFont + } private let editButton = UIButton().then{ $0.configuration = .plain() @@ -79,7 +81,7 @@ class BoxListCell: UITableViewCell { cellImageView.snp.makeConstraints { make in make.leading.equalToSuperview().inset(20) make.top.bottom.equalToSuperview().inset(10) - make.width.equalTo(30) + make.width.equalTo(25) } label.snp.makeConstraints { make in diff --git a/iBox/Sources/BoxList/Edit/EditCell.swift b/iBox/Sources/BoxList/Edit/EditCell.swift index 8bfeeaa..9bb7e56 100644 --- a/iBox/Sources/BoxList/Edit/EditCell.swift +++ b/iBox/Sources/BoxList/Edit/EditCell.swift @@ -20,6 +20,7 @@ class EditCell: UITableViewCell { } private let titleLabel = UILabel().then { + $0.font = .cellTitleFont $0.textColor = .label } diff --git a/iBox/Sources/BoxList/EditFolder/EditFolderViewController.swift b/iBox/Sources/BoxList/EditFolder/EditFolderViewController.swift index ced97c4..e72e106 100644 --- a/iBox/Sources/BoxList/EditFolder/EditFolderViewController.swift +++ b/iBox/Sources/BoxList/EditFolder/EditFolderViewController.swift @@ -44,7 +44,7 @@ class EditFolderViewController: BaseViewController, BaseViewCont func setupNavigationBar() { setNavigationBarTitleLabelText("폴더 관리") - setNavigationBarTitleLabelFont(.systemFont(ofSize: 17, weight: .semibold)) + setNavigationBarTitleLabelFont(.semiboldLabelFont) setNavigationBarAddButtonHidden(false) setNavigationBarBackButtonHidden(false) setNavigationBarAddButtonAction(#selector(addButtonTapped)) diff --git a/iBox/Sources/BoxList/FolderView.swift b/iBox/Sources/BoxList/FolderView.swift index 51cfb7d..72a43dc 100644 --- a/iBox/Sources/BoxList/FolderView.swift +++ b/iBox/Sources/BoxList/FolderView.swift @@ -16,7 +16,7 @@ class FolderView: UIView { private let folderNameLabel = UILabel().then { $0.textColor = .label - $0.font = .systemFont(ofSize: 18, weight: .semibold) + $0.font = .boldLabelFont } init() { diff --git a/iBox/Sources/Extension/UIFont+Extension.swift b/iBox/Sources/Extension/UIFont+Extension.swift new file mode 100644 index 0000000..7cf7a00 --- /dev/null +++ b/iBox/Sources/Extension/UIFont+Extension.swift @@ -0,0 +1,21 @@ +// +// UIFont+Extension.swift +// iBox +// +// Created by jiyeon on 3/26/24. +// + +import UIKit + +extension UIFont { + + static let titleFont = UIFont.systemFont(ofSize: 20.0, weight: .bold) + static let subTitlefont = UIFont.systemFont(ofSize: 17.0, weight: .semibold) + static let lableFont = UIFont.systemFont(ofSize: 16.0) + static let semiboldLabelFont = UIFont.systemFont(ofSize: 16.0, weight: .semibold) + static let boldLabelFont = UIFont.systemFont(ofSize: 16.0, weight: .bold) + static let cellTitleFont = UIFont.systemFont(ofSize: 16.0) + static let cellDescriptionFont = UIFont.systemFont(ofSize: 13.0, weight: .regular) + static let descriptionFont = UIFont.systemFont(ofSize: 14.0) + +} diff --git a/iBox/Sources/Settings/HomeTab/HomeTabSelectorCell.swift b/iBox/Sources/Settings/HomeTab/HomeTabSelectorCell.swift index 4364834..f22df25 100644 --- a/iBox/Sources/Settings/HomeTab/HomeTabSelectorCell.swift +++ b/iBox/Sources/Settings/HomeTab/HomeTabSelectorCell.swift @@ -16,7 +16,7 @@ class HomeTabSelectorCell: UITableViewCell { // MARK: - UI Components let titleLabel = UILabel().then { - $0.font = .systemFont(ofSize: 16) + $0.font = .cellTitleFont } let selectButton = UIButton().then { diff --git a/iBox/Sources/Settings/HomeTab/HomeTabSelectorViewController.swift b/iBox/Sources/Settings/HomeTab/HomeTabSelectorViewController.swift index d2c60c6..f98defb 100644 --- a/iBox/Sources/Settings/HomeTab/HomeTabSelectorViewController.swift +++ b/iBox/Sources/Settings/HomeTab/HomeTabSelectorViewController.swift @@ -25,7 +25,7 @@ class HomeTabSelectorViewController: BaseViewController, Ba func setupNavigationBar() { setNavigationBarTitleLabelText("홈화면 설정하기") - setNavigationBarTitleLabelFont(.systemFont(ofSize: 17, weight: .semibold)) + setNavigationBarTitleLabelFont(.subTitlefont) setNavigationBarBackButtonHidden(false) } diff --git a/iBox/Sources/Settings/Reset/ResetView.swift b/iBox/Sources/Settings/Reset/ResetView.swift index 9f18044..41ae9e0 100644 --- a/iBox/Sources/Settings/Reset/ResetView.swift +++ b/iBox/Sources/Settings/Reset/ResetView.swift @@ -18,12 +18,12 @@ class ResetView: UIView { let label = UILabel().then { $0.text = "경고: 이 작업을 진행하면 저장하신 모든 폴더 및 북마크 정보가 영구적으로 삭제되고 기본값으로 초기화됩니다. 진행하기 전에 중요한 정보가 없는지 다시 한번 확인해 주시기 바랍니다." $0.numberOfLines = 0 - $0.font = .systemFont(ofSize: 15) + $0.font = .descriptionFont } let resetButton = UIButton().then { $0.configuration = .plain() - $0.configuration?.attributedTitle = .init("초기화", attributes: .init([.font: UIFont.boldSystemFont(ofSize: 15)])) + $0.configuration?.attributedTitle = .init("초기화", attributes: .init([.font: UIFont.descriptionFont])) $0.tintColor = .white $0.backgroundColor = .box $0.clipsToBounds = true diff --git a/iBox/Sources/Settings/Reset/ResetViewController.swift b/iBox/Sources/Settings/Reset/ResetViewController.swift index d593220..0ecd944 100644 --- a/iBox/Sources/Settings/Reset/ResetViewController.swift +++ b/iBox/Sources/Settings/Reset/ResetViewController.swift @@ -27,7 +27,7 @@ class ResetViewController: BaseViewController, BaseViewControllerProt func setupNavigationBar() { setNavigationBarTitleLabelText("데이터 초기화") - setNavigationBarTitleLabelFont(.systemFont(ofSize: 17, weight: .semibold)) + setNavigationBarTitleLabelFont(.subTitlefont) setNavigationBarBackButtonHidden(false) } diff --git a/iBox/Sources/Settings/SettingsItemCell.swift b/iBox/Sources/Settings/SettingsItemCell.swift index b60df42..0499b84 100644 --- a/iBox/Sources/Settings/SettingsItemCell.swift +++ b/iBox/Sources/Settings/SettingsItemCell.swift @@ -17,11 +17,11 @@ class SettingsItemCell: UITableViewCell { // MARK: - UI Components let titleLabel = UILabel().then { - $0.font = .systemFont(ofSize: 16) + $0.font = .cellTitleFont } let descriptionLabel = UILabel().then { - $0.font = .systemFont(ofSize: 13, weight: .regular) + $0.font = .cellDescriptionFont $0.textColor = .gray } diff --git a/iBox/Sources/Settings/Theme/ThemeCell.swift b/iBox/Sources/Settings/Theme/ThemeCell.swift index 653aca1..4a4c9fe 100644 --- a/iBox/Sources/Settings/Theme/ThemeCell.swift +++ b/iBox/Sources/Settings/Theme/ThemeCell.swift @@ -18,7 +18,7 @@ class ThemeCell: UITableViewCell { } let titleLabel = UILabel().then { - $0.font = .systemFont(ofSize: 16) + $0.font = .cellTitleFont } let selectButton = UIButton().then { diff --git a/iBox/Sources/Settings/Theme/ThemeViewController.swift b/iBox/Sources/Settings/Theme/ThemeViewController.swift index ac645c8..463805f 100644 --- a/iBox/Sources/Settings/Theme/ThemeViewController.swift +++ b/iBox/Sources/Settings/Theme/ThemeViewController.swift @@ -25,7 +25,7 @@ class ThemeViewController: BaseViewController, BaseViewControllerProt func setupNavigationBar() { setNavigationBarTitleLabelText("다크 모드 설정") - setNavigationBarTitleLabelFont(.systemFont(ofSize: 17, weight: .semibold)) + setNavigationBarTitleLabelFont(.subTitlefont) setNavigationBarBackButtonHidden(false) }