diff --git a/project/Projects/App/ConcreteLogger/Publisher/AmplitudeLogger.swift b/project/Projects/App/ConcreteLogger/Publisher/AmplitudeLogger.swift index 2c4b9456..adb094ed 100644 --- a/project/Projects/App/ConcreteLogger/Publisher/AmplitudeLogger.swift +++ b/project/Projects/App/ConcreteLogger/Publisher/AmplitudeLogger.swift @@ -25,8 +25,9 @@ public class AmplitudeLogger: LoggerMessagePublisher { apiKey: AmplitudeConfig.apiKey ) ) - - setUserId(id: "AnonymousIOSUser") + + // 유저 아이디 설정 + setUserId(id: getAnonymousUserId()) } public func send(event: LoggingEvent) { diff --git a/project/Projects/Domain/LoggerInterface/source/LoggerMessagePublisher.swift b/project/Projects/Domain/LoggerInterface/source/LoggerMessagePublisher.swift index 1e8d1151..1c8faead 100644 --- a/project/Projects/Domain/LoggerInterface/source/LoggerMessagePublisher.swift +++ b/project/Projects/Domain/LoggerInterface/source/LoggerMessagePublisher.swift @@ -18,12 +18,6 @@ public protocol LoggerMessagePublisher: AnyObject { /// 이벤트의 주체를 설정합니다. func setUserId(id: String) - - /// 이벤트의 시작시간을 알립니다. - func startTimer(screenName: String, actionName: String) - - /// 이벤트의 종료를 알리며, 지속시간을 기록합니다. - func endTimer(screenName: String, actionName: String, isSuccess: Bool) } public extension LoggerMessagePublisher { @@ -45,6 +39,7 @@ public extension LoggerMessagePublisher { send(event: event) } + /// 이벤트의 시작시간을 알립니다. func startTimer(screenName: String, actionName: String) { timerQueue.sync { let key = screenName + actionName @@ -52,6 +47,7 @@ public extension LoggerMessagePublisher { } } + /// 이벤트의 종료를 알리며, 지속시간을 기록합니다. func endTimer(screenName: String, actionName: String, isSuccess: Bool) { timerQueue.sync { let key = screenName + actionName @@ -83,4 +79,21 @@ public extension LoggerMessagePublisher { send(event: event) } + + /// 피로깅의 주체를 인식하는 식별자를 반환합니다. + func getAnonymousUserId() -> String { + + let key = "AnonymousUserIdForDevice" + + if let cachedId = UserDefaults.standard.string(forKey: key) { + + return cachedId + } + + let id = UUID().uuidString + + UserDefaults.standard.setValue(id, forKey: key) + + return id + } } diff --git a/project/Projects/Presentation/DSKit/Sources/CommonUI/Button/BottomSheetButton.swift b/project/Projects/Presentation/DSKit/Sources/CommonUI/Button/BottomSheetButton.swift index e0fdc542..8fd86806 100644 --- a/project/Projects/Presentation/DSKit/Sources/CommonUI/Button/BottomSheetButton.swift +++ b/project/Projects/Presentation/DSKit/Sources/CommonUI/Button/BottomSheetButton.swift @@ -28,11 +28,11 @@ public class BottomSheetButton: TappableUIView { private let disposeBag = DisposeBag() - public init(image: UIImage, titleText: String, color: UIColor) { + public init(image: UIImage, titleText: String, imageColor: UIColor, textColor: UIColor) { self.imageView.image = image - self.imageView.tintColor = color + self.imageView.tintColor = imageColor self.titleLabel.textString = titleText - self.titleLabel.attrTextColor = color + self.titleLabel.attrTextColor = textColor super.init() @@ -89,6 +89,7 @@ public class BottomSheetButton: TappableUIView { BottomSheetButton( image: DSIcon.postCheck.image, titleText: "채용 종료하기", - color: DSColor.red100.color + imageColor: DSColor.red100.color, + textColor: DSColor.red100.color ) } diff --git a/project/Projects/Presentation/DSKit/Sources/CommonUI/Button/IdleUnderLineLabelButton.swift b/project/Projects/Presentation/DSKit/Sources/CommonUI/Button/IdleUnderLineLabelButton.swift index ac7142fe..ef866945 100644 --- a/project/Projects/Presentation/DSKit/Sources/CommonUI/Button/IdleUnderLineLabelButton.swift +++ b/project/Projects/Presentation/DSKit/Sources/CommonUI/Button/IdleUnderLineLabelButton.swift @@ -12,7 +12,7 @@ import RxCocoa public class IdleUnderLineLabelButton: TappableUIView { let label: IdleLabel = { - let label = IdleLabel(typography: .Body2) + let label = IdleLabel(typography: .Body3) label.attrTextColor = DSColor.gray300.color label.setAttr(attr: .underlineStyle, value: NSUnderlineStyle.single.rawValue) return label diff --git a/project/Projects/Presentation/DSKit/Sources/CommonUI/CenterInfoBox.swift b/project/Projects/Presentation/DSKit/Sources/CommonUI/CenterInfoBox.swift index 12efa44f..e809834f 100644 --- a/project/Projects/Presentation/DSKit/Sources/CommonUI/CenterInfoBox.swift +++ b/project/Projects/Presentation/DSKit/Sources/CommonUI/CenterInfoBox.swift @@ -109,11 +109,9 @@ public class InfoBox: UIView { valueStack.setContentCompressionResistancePriority(.init(750), for: .horizontal) // mainStack - [ - titleLabel, - keyValueStack - ].forEach { - mainStack.addArrangedSubview($0) + mainStack.addArrangedSubview(titleLabel) + if keyStack.arrangedSubviews.count > 0 { + mainStack.addArrangedSubview(keyValueStack) } [ diff --git a/project/Projects/Presentation/DSKit/Sources/CommonUI/ContentLabel/IdleContentLabel.swift b/project/Projects/Presentation/DSKit/Sources/CommonUI/ContentLabel/IdleContentLabel.swift index 20496688..bd7e1277 100644 --- a/project/Projects/Presentation/DSKit/Sources/CommonUI/ContentLabel/IdleContentLabel.swift +++ b/project/Projects/Presentation/DSKit/Sources/CommonUI/ContentLabel/IdleContentLabel.swift @@ -43,6 +43,7 @@ public class IdleContentTitleLabel: UIStackView { self.axis = .horizontal self.alignment = .center + self.spacing = 4 [ titleLabel, diff --git a/project/Projects/Presentation/DSKit/Sources/CommonUI/IFType1.swift b/project/Projects/Presentation/DSKit/Sources/CommonUI/IFType1.swift index 561c894c..854f9139 100644 --- a/project/Projects/Presentation/DSKit/Sources/CommonUI/IFType1.swift +++ b/project/Projects/Presentation/DSKit/Sources/CommonUI/IFType1.swift @@ -61,7 +61,7 @@ public class IFType1: UIStackView { func setStack() { - self.alignment = .top + self.alignment = .fill self.axis = .horizontal self.spacing = 4.0 } diff --git a/project/Projects/Presentation/DSKit/Sources/Component/Button/TextButtonType1.swift b/project/Projects/Presentation/DSKit/Sources/Component/Button/TextButtonType1.swift index 211df3aa..37cf9d7c 100644 --- a/project/Projects/Presentation/DSKit/Sources/Component/Button/TextButtonType1.swift +++ b/project/Projects/Presentation/DSKit/Sources/Component/Button/TextButtonType1.swift @@ -23,7 +23,7 @@ public class TextButtonType1: UIView { let label = IdleLabel(typography: .Subtitle4) label.textString = labelText - label.textColor = .white + label.attrTextColor = .white label.textAlignment = .center return label diff --git a/project/Projects/Presentation/DSKit/Sources/Component/Label/IdleLabel.swift b/project/Projects/Presentation/DSKit/Sources/Component/Label/IdleLabel.swift index 989fd30b..64fc8f56 100644 --- a/project/Projects/Presentation/DSKit/Sources/Component/Label/IdleLabel.swift +++ b/project/Projects/Presentation/DSKit/Sources/Component/Label/IdleLabel.swift @@ -28,16 +28,6 @@ public class IdleLabel: UILabel { public required init?(coder: NSCoder) { fatalError() } - public override var intrinsicContentSize: CGSize { - - let size = super.intrinsicContentSize - - if currentLineCount != 0 { - return CGSize(width: size.width, height: typography.lineHeight * CGFloat(currentLineCount)) - } - return super.intrinsicContentSize - } - public var typography: Typography { get { currentTypography @@ -58,42 +48,17 @@ public class IdleLabel: UILabel { } } - var wholeRangeParagraphStyle: NSMutableParagraphStyle? { - - if let text = attributedText?.string, text.isEmpty { - return nil - } - - var paragraph: NSMutableParagraphStyle - - if let prevParagraph = self.attributedText?.attribute(.paragraphStyle, at: 0, effectiveRange: nil) as? NSMutableParagraphStyle { - paragraph = prevParagraph - } else { - paragraph = NSMutableParagraphStyle() - } - - return paragraph - } - public override var textAlignment: NSTextAlignment { get { super.textAlignment } set { - if let paragraphStyle = wholeRangeParagraphStyle { - paragraphStyle.alignment = newValue - - if let attrText = self.attributedText { - let mutableAttr = NSMutableAttributedString(attributedString: attrText) - let range = NSRange(location: 0, length: mutableAttr.length) - mutableAttr.addAttribute(.paragraphStyle, value: paragraphStyle, range: range) - - self.attributedText = mutableAttr - } - } - + let paragraphStyle = currentAttributes[.paragraphStyle] as! NSMutableParagraphStyle + paragraphStyle.alignment = newValue super.textAlignment = newValue + + updateText() } } @@ -121,23 +86,12 @@ public class IdleLabel: UILabel { let newAttr: [NSAttributedString.Key: Any] = [attr: value] currentAttributes = newAttr.merging(currentAttributes) { first, _ in first } updateText() - invalidateIntrinsicContentSize() } private func updateText() { - let attributedStr = NSMutableAttributedString(string: textString, attributes: currentAttributes) - - if let fontHeight = (currentTypography.attributes[.font] as? UIFont)?.lineHeight { - - if let paragraphStyle = wholeRangeParagraphStyle { - - paragraphStyle.lineSpacing = currentTypography.lineHeight-fontHeight - - attributedStr.addAttribute(.paragraphStyle, value: paragraphStyle, range: NSMakeRange(0, attributedStr.length)) - } - } + let attributedStr = NSMutableAttributedString(string: currentText, attributes: currentAttributes) - self.rx.attributedText.onNext(attributedStr) - invalidateIntrinsicContentSize() + self.attributedText = attributedStr + self.sizeToFit() } } diff --git a/project/Projects/Presentation/DSKit/Sources/Component/TextField/IdleOneLineInputField.swift b/project/Projects/Presentation/DSKit/Sources/Component/TextField/IdleOneLineInputField.swift index dcd7715a..b9fb5fde 100644 --- a/project/Projects/Presentation/DSKit/Sources/Component/TextField/IdleOneLineInputField.swift +++ b/project/Projects/Presentation/DSKit/Sources/Component/TextField/IdleOneLineInputField.swift @@ -101,7 +101,7 @@ public class IdleOneLineInputField: UIView { self.layer.borderColor = borderColor.cgColor // Initial setting - textField.placeholder = placeHolderText + textField.attrPlaceholder = placeHolderText textField.keyboardType = keyboardType textField.contentVerticalAlignment = .center @@ -261,6 +261,7 @@ extension IdleOneLineInputField: DisablableComponent { self.isEnabled = isEnabled self.isUserInteractionEnabled = isEnabled + clearButton.isHidden = true textField.textColor = isEnabled ? .black : DSKitAsset.Colors.gray300.color self.backgroundColor = isEnabled ? .white : DSKitAsset.Colors.gray050.color diff --git a/project/Projects/Presentation/DSKit/Sources/Component/TextField/IdleTextField.swift b/project/Projects/Presentation/DSKit/Sources/Component/TextField/IdleTextField.swift index 214d584d..c6c279c2 100644 --- a/project/Projects/Presentation/DSKit/Sources/Component/TextField/IdleTextField.swift +++ b/project/Projects/Presentation/DSKit/Sources/Component/TextField/IdleTextField.swift @@ -136,25 +136,6 @@ public extension IdleTextField { } private func setInset(bounds: CGRect) -> CGRect { - let height = (currentTypography.attributes[.font] as! UIFont).lineHeight - - let verticalInset = currentTextFieldInsets.top + currentTextFieldInsets.bottom - - // 실제 폰트와 attribute의 라인 Height이 상이함으로 이를 조정하는 과정입니다. - var topInset: CGFloat = 0 - var bottomInset: CGFloat = 0 - - if verticalInset > 0 { - topInset = (currentTypography.lineHeight+verticalInset - height) * (currentTextFieldInsets.top/verticalInset) - - bottomInset = (currentTypography.lineHeight+verticalInset - height) * (currentTextFieldInsets.bottom/verticalInset) - } - - return bounds.inset(by: .init( - top: topInset, - left: currentTextFieldInsets.left, - bottom: bottomInset, - right: currentTextFieldInsets.right - )) + bounds.inset(by: currentTextFieldInsets) } } diff --git a/project/Projects/Presentation/DSKit/Sources/Component/Typography/Typograpy.swift b/project/Projects/Presentation/DSKit/Sources/Component/Typography/Typograpy.swift index 9daf8d98..71ca7468 100644 --- a/project/Projects/Presentation/DSKit/Sources/Component/Typography/Typograpy.swift +++ b/project/Projects/Presentation/DSKit/Sources/Component/Typography/Typograpy.swift @@ -34,34 +34,37 @@ public enum Typography { case caption case caption2 - var lineHeight: CGFloat { + var lineHeight: CGFloat? { switch self { case .Heading1: - 34.8 + 36 case .Heading2: - 28 + 32 case .Heading3: - 24 + 30 case .Heading4: - 22 + 26 + + case .Subtitle1: - 28 + 32 case .Subtitle2: - 24 + 30 case .Subtitle3: - 22 + 26 case .Subtitle4: - 20 + 22 + + case .Body1: - 24 + 30 case .Body2: - 22 + 26 case .Body3: - 20 - case .caption: - 18.6 - case .caption2: - 18.6 + 22 + + default: + nil } } @@ -69,91 +72,91 @@ public enum Typography { switch self { case .Heading1: - Self.createAttribute( + createAttribute( weight: .Bold, size: 24, letterSpacing: -0.2, color: DSKitAsset.Colors.gray900.color ) case .Heading2: - Self.createAttribute( + createAttribute( weight: .Bold, size: 20, letterSpacing: -0.2, color: DSKitAsset.Colors.gray900.color ) case .Heading3: - Self.createAttribute( + createAttribute( weight: .Bold, size: 18, letterSpacing: -0.2, color: DSKitAsset.Colors.gray900.color ) case .Heading4: - Self.createAttribute( + createAttribute( weight: .Bold, size: 16, letterSpacing: -0.2, color: DSKitAsset.Colors.gray900.color ) case .Subtitle1: - Self.createAttribute( + createAttribute( weight: .Semibold, size: 20, letterSpacing: -0.2, color: DSKitAsset.Colors.gray900.color ) case .Subtitle2: - Self.createAttribute( + createAttribute( weight: .Semibold, size: 18, letterSpacing: -0.2, color: DSKitAsset.Colors.gray900.color ) case .Subtitle3: - Self.createAttribute( + createAttribute( weight: .Semibold, size: 16, letterSpacing: -0.2, color: DSKitAsset.Colors.gray900.color ) case .Subtitle4: - Self.createAttribute( + createAttribute( weight: .Semibold, size: 14, letterSpacing: -0.2, color: DSKitAsset.Colors.gray900.color ) case .Body1: - Self.createAttribute( + createAttribute( weight: .medium, size: 18, letterSpacing: -0.2, color: DSKitAsset.Colors.gray900.color ) case .Body2: - Self.createAttribute( + createAttribute( weight: .medium, size: 16, letterSpacing: -0.2, color: DSKitAsset.Colors.gray900.color ) case .Body3: - Self.createAttribute( + createAttribute( weight: .medium, size: 14, letterSpacing: -0.2, color: DSKitAsset.Colors.gray900.color ) case .caption: - Self.createAttribute( + createAttribute( weight: .medium, size: 12, letterSpacing: -0.2, color: DSKitAsset.Colors.gray900.color ) case .caption2: - Self.createAttribute( + createAttribute( weight: .Semibold, size: 12, letterSpacing: -0.2, @@ -162,7 +165,7 @@ public enum Typography { } } - static func createAttribute( + func createAttribute( weight: FontWeight, size: CGFloat, letterSpacing: CGFloat, @@ -179,10 +182,23 @@ public enum Typography { font = DSKitFontFamily.Pretendard.medium.font(size: size) } + let paragraphStyle = NSMutableParagraphStyle() + + var baseLineOffset: CGFloat = 0.0 + + if let lineHeight { + paragraphStyle.minimumLineHeight = lineHeight + paragraphStyle.maximumLineHeight = lineHeight + + baseLineOffset = (lineHeight-size)/2 + } + return [ .font: font!, .foregroundColor: color, - .kern: letterSpacing + .kern: letterSpacing, + .paragraphStyle : paragraphStyle, + .baselineOffset : baseLineOffset ] } } diff --git a/project/Projects/Presentation/Feature/Auth/ExampleApp/Sources/SceneDelegate.swift b/project/Projects/Presentation/Feature/Auth/ExampleApp/Sources/SceneDelegate.swift index b67dab5d..20f0a5ce 100644 --- a/project/Projects/Presentation/Feature/Auth/ExampleApp/Sources/SceneDelegate.swift +++ b/project/Projects/Presentation/Feature/Auth/ExampleApp/Sources/SceneDelegate.swift @@ -7,6 +7,8 @@ import UIKit import AuthFeature +import BaseFeature +import PresentationCore class SceneDelegate: UIResponder, UIWindowSceneDelegate { @@ -16,10 +18,17 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate { guard let windowScene = scene as? UIWindowScene else { return } + let renderObject: AnonymousCompleteVCRenderObject = .init( + titleText: "센터관리자 로그인을\n완료했어요!", + descriptionText: "로그인 정보는 마지막 접속일부터\n180일간 유지될 예정이에요.", + completeButtonText: "시작하기") { } + + let vc = AnonymousCompleteVC() + vc.applyRO(renderObject) window = UIWindow(windowScene: windowScene) - window?.rootViewController = UIViewController() + window?.rootViewController = vc window?.makeKeyAndVisible() } } diff --git a/project/Projects/Presentation/Feature/Auth/Sources/View/Center/Register/AuthBusinessOwnerViewController.swift b/project/Projects/Presentation/Feature/Auth/Sources/View/Center/Register/AuthBusinessOwnerViewController.swift index 3dca9e8f..4506bc11 100644 --- a/project/Projects/Presentation/Feature/Auth/Sources/View/Center/Register/AuthBusinessOwnerViewController.swift +++ b/project/Projects/Presentation/Feature/Auth/Sources/View/Center/Register/AuthBusinessOwnerViewController.swift @@ -96,13 +96,12 @@ where T.Input: AuthBusinessOwnerInputable & PageProcessInputable, T.Output: Auth view.backgroundColor = .clear } - private func setAppearance() { - - view.layoutMargins = .init(top: 32, left: 20, bottom: 0, right: 20) - } + private func setAppearance() { } private func setAutoLayout() { + view.layoutMargins = .init(top: 28, left: 20, bottom: 0, right: 20) + [ processTitle, businessNumberField, @@ -115,7 +114,7 @@ where T.Input: AuthBusinessOwnerInputable & PageProcessInputable, T.Output: Auth } NSLayoutConstraint.activate([ - processTitle.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor), + processTitle.topAnchor.constraint(equalTo: view.layoutMarginsGuide.topAnchor), processTitle.leadingAnchor.constraint(equalTo: view.layoutMarginsGuide.leadingAnchor), processTitle.trailingAnchor.constraint(equalTo: view.layoutMarginsGuide.trailingAnchor), @@ -127,7 +126,7 @@ where T.Input: AuthBusinessOwnerInputable & PageProcessInputable, T.Output: Auth isThatRightLabel.leadingAnchor.constraint(equalTo: view.layoutMarginsGuide.leadingAnchor), isThatRightLabel.trailingAnchor.constraint(equalTo: view.layoutMarginsGuide.trailingAnchor), - centerInfoBox.topAnchor.constraint(equalTo: isThatRightLabel.bottomAnchor, constant: 20), + centerInfoBox.topAnchor.constraint(equalTo: isThatRightLabel.bottomAnchor, constant: 6), centerInfoBox.leadingAnchor.constraint(equalTo: view.layoutMarginsGuide.leadingAnchor), centerInfoBox.trailingAnchor.constraint(equalTo: view.layoutMarginsGuide.trailingAnchor), diff --git a/project/Projects/Presentation/Feature/Auth/Sources/View/Center/Register/CenterRegisterViewController.swift b/project/Projects/Presentation/Feature/Auth/Sources/View/Center/Register/CenterRegisterViewController.swift index 2c01fbfc..a43e2e2c 100644 --- a/project/Projects/Presentation/Feature/Auth/Sources/View/Center/Register/CenterRegisterViewController.swift +++ b/project/Projects/Presentation/Feature/Auth/Sources/View/Center/Register/CenterRegisterViewController.swift @@ -90,7 +90,7 @@ class CenterRegisterViewController: DisposableViewController { statusBar.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: 20), statusBar.trailingAnchor.constraint(equalTo: view.trailingAnchor, constant: -20), - pageViewController.view.topAnchor.constraint(equalTo: statusBar.bottomAnchor, constant: 32), + pageViewController.view.topAnchor.constraint(equalTo: statusBar.bottomAnchor), pageViewController.view.leadingAnchor.constraint(equalTo: view.leadingAnchor), pageViewController.view.trailingAnchor.constraint(equalTo: view.trailingAnchor), pageViewController.view.bottomAnchor.constraint(equalTo: view.safeAreaLayoutGuide.bottomAnchor, constant: -16), diff --git a/project/Projects/Presentation/Feature/Auth/Sources/View/Center/Register/SetIdPasswordViewController.swift b/project/Projects/Presentation/Feature/Auth/Sources/View/Center/Register/SetIdPasswordViewController.swift index fc2daf5e..4f6293d2 100644 --- a/project/Projects/Presentation/Feature/Auth/Sources/View/Center/Register/SetIdPasswordViewController.swift +++ b/project/Projects/Presentation/Feature/Auth/Sources/View/Center/Register/SetIdPasswordViewController.swift @@ -38,25 +38,19 @@ where T.Input: SetIdInputable & SetPasswordInputable & PageProcessInputable, var coordinator: CenterRegisterCoordinator? // View - private let processTitle: ResizableUILabel = { - - let label = ResizableUILabel() - - label.text = "아이디와 비밀번호를 설정해주세요." - label.font = DSKitFontFamily.Pretendard.bold.font(size: 20) + private let processTitleLabel: IdleLabel = { + let label = IdleLabel(typography: .Heading2) + label.textString = "아이디와 비밀번호를 설정해주세요." label.textAlignment = .left - return label }() // MARK: Id 입력 - private let idLabel: ResizableUILabel = { - - let label = ResizableUILabel() - label.font = DSKitFontFamily.Pretendard.semiBold.font(size: 14) - label.text = "아이디 설정" + private let idLabel: IdleLabel = { + let label = IdleLabel(typography: .Subtitle4) + label.textString = "아이디 설정" + label.attrTextColor = DSColor.gray500.color label.textAlignment = .left - return label }() private let idField: IFType1 = { @@ -82,13 +76,11 @@ where T.Input: SetIdInputable & SetPasswordInputable & PageProcessInputable, }() // MARK: 비밀번호 입력 - private let passwordLabel: ResizableUILabel = { - - let label = ResizableUILabel() - label.font = DSKitFontFamily.Pretendard.semiBold.font(size: 14) - label.text = "비밀번호 설정" + private let passwordLabel: IdleLabel = { + let label = IdleLabel(typography: .Subtitle4) + label.textString = "비밀번호 설정" + label.attrTextColor = DSColor.gray500.color label.textAlignment = .left - return label }() private let passwordField: IdleOneLineInputField = { @@ -111,13 +103,11 @@ where T.Input: SetIdInputable & SetPasswordInputable & PageProcessInputable, }() // MARK: 비밀번호 확인 입력 - private let checlPasswordLabel: ResizableUILabel = { - - let label = ResizableUILabel() - label.font = DSKitFontFamily.Pretendard.semiBold.font(size: 14) - label.text = "비밀번호 확인" + private let checlPasswordLabel: IdleLabel = { + let label = IdleLabel(typography: .Subtitle4) + label.textString = "비밀번호 확인" + label.attrTextColor = DSColor.gray500.color label.textAlignment = .left - return label }() private let checkPasswordField: IdleOneLineInputField = { @@ -154,15 +144,14 @@ where T.Input: SetIdInputable & SetPasswordInputable & PageProcessInputable, view.backgroundColor = .clear } - private func setAppearance() { - - view.layoutMargins = .init(top: 32, left: 20, bottom: 0, right: 20) - } + private func setAppearance() { } private func setAutoLayout() { + view.layoutMargins = .init(top: 28, left: 20, bottom: 0, right: 20) + [ - processTitle, + processTitleLabel, idLabel, idField, thisIsValidIdLabel, @@ -179,11 +168,11 @@ where T.Input: SetIdInputable & SetPasswordInputable & PageProcessInputable, NSLayoutConstraint.activate([ - processTitle.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor), - processTitle.leadingAnchor.constraint(equalTo: view.layoutMarginsGuide.leadingAnchor), - processTitle.trailingAnchor.constraint(equalTo: view.layoutMarginsGuide.trailingAnchor), + processTitleLabel.topAnchor.constraint(equalTo: view.layoutMarginsGuide.topAnchor), + processTitleLabel.leadingAnchor.constraint(equalTo: view.layoutMarginsGuide.leadingAnchor), + processTitleLabel.trailingAnchor.constraint(equalTo: view.layoutMarginsGuide.trailingAnchor), - idLabel.topAnchor.constraint(equalTo: processTitle.bottomAnchor, constant: 32), + idLabel.topAnchor.constraint(equalTo: processTitleLabel.bottomAnchor, constant: 32), idLabel.leadingAnchor.constraint(equalTo: view.layoutMarginsGuide.leadingAnchor), idLabel.trailingAnchor.constraint(equalTo: view.layoutMarginsGuide.trailingAnchor), diff --git a/project/Projects/Presentation/Feature/Auth/Sources/View/Common/Register/EnterNameViewController.swift b/project/Projects/Presentation/Feature/Auth/Sources/View/Common/Register/EnterNameViewController.swift index e16383f5..5b218cd6 100644 --- a/project/Projects/Presentation/Feature/Auth/Sources/View/Common/Register/EnterNameViewController.swift +++ b/project/Projects/Presentation/Feature/Auth/Sources/View/Common/Register/EnterNameViewController.swift @@ -77,13 +77,12 @@ where T.Input: EnterNameInputable & PageProcessInputable, T.Output: EnterNameOut view.backgroundColor = .clear } - private func setAppearance() { - - view.layoutMargins = .init(top: 32, left: 20, bottom: 0, right: 20) - } + private func setAppearance() { } private func setAutoLayout() { + view.layoutMargins = .init(top: 28, left: 20, bottom: 0, right: 20) + [ processTitle, textField, diff --git a/project/Projects/Presentation/Feature/Auth/Sources/View/Common/Register/ValidatePhoneNumberViewController.swift b/project/Projects/Presentation/Feature/Auth/Sources/View/Common/Register/ValidatePhoneNumberViewController.swift index 539f8a06..7d29a15b 100644 --- a/project/Projects/Presentation/Feature/Auth/Sources/View/Common/Register/ValidatePhoneNumberViewController.swift +++ b/project/Projects/Presentation/Feature/Auth/Sources/View/Common/Register/ValidatePhoneNumberViewController.swift @@ -127,13 +127,12 @@ where view.backgroundColor = .clear } - private func setAppearance() { - - view.layoutMargins = .init(top: 32, left: 20, bottom: 0, right: 20) - } + private func setAppearance() { } private func setAutoLayout() { + view.layoutMargins = .init(top: 28, left: 20, bottom: 0, right: 20) + [ processTitle, phoneNumberLabel, diff --git a/project/Projects/Presentation/Feature/Auth/Sources/View/Worker/Register/EnterAddressViewController.swift b/project/Projects/Presentation/Feature/Auth/Sources/View/Worker/Register/EnterAddressViewController.swift index b84bc07e..f3f52b21 100644 --- a/project/Projects/Presentation/Feature/Auth/Sources/View/Worker/Register/EnterAddressViewController.swift +++ b/project/Projects/Presentation/Feature/Auth/Sources/View/Worker/Register/EnterAddressViewController.swift @@ -73,11 +73,12 @@ where T.Input: EnterAddressInputable & PageProcessInputable, T: BaseViewModel { private func setAppearance() { self.view.backgroundColor = .white - view.layoutMargins = .init(top: 32, left: 20, bottom: 0, right: 20) } private func setAutoLayout() { + view.layoutMargins = .init(top: 28, left: 20, bottom: 0, right: 20) + let stack1 = VStack( [ processTitle1, diff --git a/project/Projects/Presentation/Feature/Auth/Sources/View/Worker/Register/EntetPersonalInfoViewController.swift b/project/Projects/Presentation/Feature/Auth/Sources/View/Worker/Register/EntetPersonalInfoViewController.swift index e1fcacb5..1ddf1041 100644 --- a/project/Projects/Presentation/Feature/Auth/Sources/View/Worker/Register/EntetPersonalInfoViewController.swift +++ b/project/Projects/Presentation/Feature/Auth/Sources/View/Worker/Register/EntetPersonalInfoViewController.swift @@ -96,10 +96,12 @@ where T.Input: WorkerPersonalInfoInputable & PageProcessInputable, func setAppearance() { self.view.backgroundColor = .white - view.layoutMargins = .init(top: 32, left: 20, bottom: 0, right: 20) } private func setAutoLayout() { + + view.layoutMargins = .init(top: 28, left: 20, bottom: 0, right: 20) + let genderButtonStack = VStack( [ { diff --git a/project/Projects/Presentation/Feature/Auth/Sources/View/Worker/WorkerRegisterViewController.swift b/project/Projects/Presentation/Feature/Auth/Sources/View/Worker/WorkerRegisterViewController.swift index 5bb62d48..9fe0de77 100644 --- a/project/Projects/Presentation/Feature/Auth/Sources/View/Worker/WorkerRegisterViewController.swift +++ b/project/Projects/Presentation/Feature/Auth/Sources/View/Worker/WorkerRegisterViewController.swift @@ -80,7 +80,7 @@ class WorkerRegisterViewController: BaseViewController { statusBar.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: 20), statusBar.trailingAnchor.constraint(equalTo: view.trailingAnchor, constant: -20), - pageViewController.view.topAnchor.constraint(equalTo: statusBar.bottomAnchor, constant: 32), + pageViewController.view.topAnchor.constraint(equalTo: statusBar.bottomAnchor), pageViewController.view.leadingAnchor.constraint(equalTo: view.leadingAnchor), pageViewController.view.trailingAnchor.constraint(equalTo: view.trailingAnchor), pageViewController.view.bottomAnchor.constraint(equalTo: view.safeAreaLayoutGuide.bottomAnchor, constant: -16), diff --git a/project/Projects/Presentation/Feature/Base/Sources/View/ViewController/BottomSheet/IdleBottomSheetVC.swift b/project/Projects/Presentation/Feature/Base/Sources/View/ViewController/BottomSheet/IdleBottomSheetVC.swift index 21ab2019..f3127b5b 100644 --- a/project/Projects/Presentation/Feature/Base/Sources/View/ViewController/BottomSheet/IdleBottomSheetVC.swift +++ b/project/Projects/Presentation/Feature/Base/Sources/View/ViewController/BottomSheet/IdleBottomSheetVC.swift @@ -99,10 +99,17 @@ open class IdleBottomSheetVC: BaseViewController { func setGesture() { - let recognizer = UIPanGestureRecognizer() - recognizer.addTarget(self, action: #selector(onPanGesture(_:))) + // MARK: 드래그 + let dragRecognizer = UIPanGestureRecognizer() + dragRecognizer.addTarget(self, action: #selector(onPanGesture(_:))) - view.addGestureRecognizer(recognizer) + dragSpace.addGestureRecognizer(dragRecognizer) + + // MARK: 탭 + let tapGesture = UITapGestureRecognizer() + tapGesture.addTarget(self, action: #selector(tapForDismiss(_:))) + + view.addGestureRecognizer(tapGesture) } } @@ -124,7 +131,7 @@ extension IdleBottomSheetVC { sheetView.isUserInteractionEnabled = false sheetView.transform = .init(translationX: 0, y: height) - UIView.animate(withDuration: 0.35) { [sheetView, weak view] in + UIView.animate(withDuration: 0.35) { [sheetView, view] in sheetView.transform = .identity view?.backgroundColor = .black.withAlphaComponent(0.5) } completion: { [sheetView] _ in @@ -137,7 +144,7 @@ extension IdleBottomSheetVC { let height = sheetView.bounds.height sheetView.isUserInteractionEnabled = false - UIView.animate(withDuration: 0.2) { [sheetView, weak view] in + UIView.animate(withDuration: 0.2) { [sheetView, view] in sheetView.transform = .init(translationX: 0, y: height) view?.backgroundColor = .black.withAlphaComponent(0.0) } completion: { [weak self] _ in @@ -151,6 +158,19 @@ extension IdleBottomSheetVC { /// 제스처 동작 extension IdleBottomSheetVC { + @objc + func tapForDismiss(_ gesture: UITapGestureRecognizer) { + + var tapArea = view.frame + tapArea.size.height = sheetView.frame.origin.y + + let loc = gesture.location(in: view) + + if tapArea.contains(loc) { + dismissView() + } + } + @objc func onPanGesture(_ gesture: UIPanGestureRecognizer) { diff --git a/project/Projects/Presentation/Feature/Center/Sources/View/Profile/CenterProfileViewController.swift b/project/Projects/Presentation/Feature/Center/Sources/View/Profile/CenterProfileViewController.swift index e3d3c06f..74c23c53 100644 --- a/project/Projects/Presentation/Feature/Center/Sources/View/Profile/CenterProfileViewController.swift +++ b/project/Projects/Presentation/Feature/Center/Sources/View/Profile/CenterProfileViewController.swift @@ -53,7 +53,7 @@ public class CenterProfileViewController: BaseViewController { /// ☑️ 센터 상세정보 ☑️ let centerDetailLabel: IdleLabel = { - let label = IdleLabel(typography: .Body2) + let label = IdleLabel(typography: .Subtitle1) label.textString = "센터 상세 정보" return label }() diff --git a/project/Projects/Presentation/Feature/Center/Sources/View/RecruitmentPost/DetailVC/PostDetailForCenterBottomSheetVC.swift b/project/Projects/Presentation/Feature/Center/Sources/View/RecruitmentPost/DetailVC/PostDetailForCenterBottomSheetVC.swift index dc19bbd1..77f76610 100644 --- a/project/Projects/Presentation/Feature/Center/Sources/View/RecruitmentPost/DetailVC/PostDetailForCenterBottomSheetVC.swift +++ b/project/Projects/Presentation/Feature/Center/Sources/View/RecruitmentPost/DetailVC/PostDetailForCenterBottomSheetVC.swift @@ -25,8 +25,18 @@ class OngoingPostOptionVC: IdleBottomSheetVC { label.textAlignment = .center return label }() - let editPostButton: BottomSheetButton = .init(image: DSIcon.postEdit.image, titleText: "공고 수정하기", color: DSColor.gray900.color) - private let closePostButton: BottomSheetButton = .init(image: DSIcon.postCheck.image, titleText: "채용 종료하기", color: DSColor.red200.color) + let editPostButton: BottomSheetButton = .init( + image: DSIcon.postEdit.image, + titleText: "공고 수정하기", + imageColor: DSColor.gray500.color, + textColor: DSColor.gray900.color + ) + private let closePostButton: BottomSheetButton = .init( + image: DSIcon.postCheck.image, + titleText: "채용 종료하기", + imageColor: DSColor.red200.color, + textColor: DSColor.red200.color + ) let closePostConfirmed: PublishRelay = .init() public override init() { @@ -109,7 +119,12 @@ class ClosedPostOptionVC: IdleBottomSheetVC { label.textAlignment = .center return label }() - let removePostButton: BottomSheetButton = .init(image: DSIcon.trashBox.image, titleText: "공고 삭제하기", color: DSColor.red200.color) + let removePostButton: BottomSheetButton = .init( + image: DSIcon.trashBox.image, + titleText: "공고 삭제하기", + imageColor: DSColor.red200.color, + textColor: DSColor.red200.color + ) let removeConfirmed: PublishRelay = .init() diff --git a/project/Projects/Presentation/Feature/Center/Sources/View/RecruitmentPost/Overview/PostOverviewVC.swift b/project/Projects/Presentation/Feature/Center/Sources/View/RecruitmentPost/Overview/PostOverviewVC.swift index ff32ca00..0441bfff 100644 --- a/project/Projects/Presentation/Feature/Center/Sources/View/RecruitmentPost/Overview/PostOverviewVC.swift +++ b/project/Projects/Presentation/Feature/Center/Sources/View/RecruitmentPost/Overview/PostOverviewVC.swift @@ -64,7 +64,7 @@ public class PostOverviewVC: BaseViewController { let titleLabel: IdleLabel = { let label = IdleLabel(typography: .Heading1) - label.textString = "다음의 공고 정보가 맞지\n확인해주세요." + label.textString = "다음의 공고 정보가 맞는지\n확인해주세요." label.textAlignment = .left label.numberOfLines = 2 return label @@ -78,7 +78,7 @@ public class PostOverviewVC: BaseViewController { let sampleCard: WorkerNativeEmployCard = { let card = WorkerNativeEmployCard() - card.starButton.isUserInteractionEnabled = false + card.starButton.isHidden = true return card }() diff --git a/project/Projects/Presentation/Feature/Worker/Sources/View/RecruitmentPost/OnGoingPostBoard/WorkerRecruitmentPostBoardVC.swift b/project/Projects/Presentation/Feature/Worker/Sources/View/RecruitmentPost/OnGoingPostBoard/WorkerRecruitmentPostBoardVC.swift index 6866201f..13c11f7d 100644 --- a/project/Projects/Presentation/Feature/Worker/Sources/View/RecruitmentPost/OnGoingPostBoard/WorkerRecruitmentPostBoardVC.swift +++ b/project/Projects/Presentation/Feature/Worker/Sources/View/RecruitmentPost/OnGoingPostBoard/WorkerRecruitmentPostBoardVC.swift @@ -103,7 +103,8 @@ public class WorkerRecruitmentPostBoardVC: BaseViewController { .bind(to: viewModel.editProfileButtonClicked) .disposed(by: disposeBag) - self.rx.viewDidLoad + self.rx.viewWillAppear + .map { _ in () } .bind(to: viewModel.requestWorkerLocation) .disposed(by: disposeBag) diff --git a/project/Projects/Presentation/Feature/Worker/Sources/View/Setting/WorkerSettingVC.swift b/project/Projects/Presentation/Feature/Worker/Sources/View/Setting/WorkerSettingVC.swift index 5dc79568..1f05bbc2 100644 --- a/project/Projects/Presentation/Feature/Worker/Sources/View/Setting/WorkerSettingVC.swift +++ b/project/Projects/Presentation/Feature/Worker/Sources/View/Setting/WorkerSettingVC.swift @@ -41,7 +41,7 @@ public class WorkerSettingVC: BaseViewController { return button }() let applicationPolicyButton: FullRowButton = { - let button = FullRowButton(labelText: "약관및 정책") + let button = FullRowButton(labelText: "약관 및 정책") return button }() let personalDataProcessingPolicyButton: FullRowButton = {