From 994294cf4aac36dc5fc217ec2ebe7ffc92299c71 Mon Sep 17 00:00:00 2001 From: youz2me Date: Fri, 9 Aug 2024 02:47:53 +0900 Subject: [PATCH] =?UTF-8?q?refactor/#277=20JoinButtonView=20=ED=85=8D?= =?UTF-8?q?=EC=8A=A4=ED=8A=B8=20=EC=84=A4=EC=A0=95=20=ED=95=A8=EC=88=98=20?= =?UTF-8?q?=EB=8C=80=EC=8B=A0=20=EC=83=9D=EC=84=B1=EC=9E=90=EB=A1=9C=20?= =?UTF-8?q?=EC=B4=88=EA=B8=B0=ED=99=94=20=EA=B0=80=EB=8A=A5=ED=95=98?= =?UTF-8?q?=EB=8F=84=EB=A1=9D=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../View/CheckInviteCodeView.swift | 18 ++++++----- .../CheckInviteCode/View/JoinButtonView.swift | 32 +++++++------------ 2 files changed, 22 insertions(+), 28 deletions(-) diff --git a/KkuMulKum/Source/MeetingCreate/CheckInviteCode/View/CheckInviteCodeView.swift b/KkuMulKum/Source/MeetingCreate/CheckInviteCode/View/CheckInviteCodeView.swift index acb3395d..24ccb722 100644 --- a/KkuMulKum/Source/MeetingCreate/CheckInviteCode/View/CheckInviteCodeView.swift +++ b/KkuMulKum/Source/MeetingCreate/CheckInviteCode/View/CheckInviteCodeView.swift @@ -11,19 +11,21 @@ class CheckInviteCodeView: BaseView { // MARK: Property + + let enterInviteCodeView: JoinButtonView = JoinButtonView( + mainTitle: "초대 코드를 받았다면", + subTitle: "초대 코드가 없다면" + ) + + let createMeetingView: JoinButtonView = JoinButtonView( + mainTitle: "초대 코드 입력하기", + subTitle: "직접 모임 추가하기" + ) private let checkInviteLabel: UILabel = UILabel().then { $0.setText("친구에게 받은\n모임 초대 코드가 있으신가요?", style: .head01, color: .gray8) } - let enterInviteCodeView: JoinButtonView = JoinButtonView().then { - $0.setJoinButtonViewStatus(isReceived: true) - } - - let createMeetingView: JoinButtonView = JoinButtonView().then { - $0.setJoinButtonViewStatus(isReceived: false) - } - // MARK: - Setup diff --git a/KkuMulKum/Source/MeetingCreate/CheckInviteCode/View/JoinButtonView.swift b/KkuMulKum/Source/MeetingCreate/CheckInviteCode/View/JoinButtonView.swift index 5c561834..cdc74188 100644 --- a/KkuMulKum/Source/MeetingCreate/CheckInviteCode/View/JoinButtonView.swift +++ b/KkuMulKum/Source/MeetingCreate/CheckInviteCode/View/JoinButtonView.swift @@ -27,7 +27,18 @@ class JoinButtonView: BaseView { // MARK: - Setup - + + init(mainTitle: String, subTitle: String) { + super.init(frame: .zero) + + mainTitleLabel.setText(mainTitle, style: .body03, color: .gray8) + subTitleLabel.setText(subTitle, style: .caption02, color: .gray5) + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + override func setupView() { self.backgroundColor = .green1 @@ -58,22 +69,3 @@ class JoinButtonView: BaseView { } } } - - -// MARK: - Extension - -extension JoinButtonView { - func setJoinButtonViewStatus(isReceived: Bool) { - subTitleLabel.setText( - isReceived ? "초대 코드를 받았다면" : "초대 코드가 없다면", - style: .caption02, - color: .gray5 - ) - - mainTitleLabel.setText( - isReceived ? "초대 코드 입력하기" : "직접 모임 추가하기", - style: .body03, - color: .gray8 - ) - } -}