From 56e52478e2dd515187e7cc090bb3d9db0f8b60ad Mon Sep 17 00:00:00 2001 From: "In Ye, Kim" Date: Mon, 2 Dec 2024 22:46:42 +0900 Subject: [PATCH 1/4] =?UTF-8?q?hotfix=20=ED=82=A4=EB=B3=B4=EB=93=9C?= =?UTF-8?q?=EA=B4=80=EB=A0=A8=20=EB=AC=B8=EC=A0=9C=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/Chating/Views/ChattingListView.swift | 9 ++++++++- .../ViewControllers/LiveStreamViewController.swift | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Projects/Features/LiveStreamFeature/Sources/Chating/Views/ChattingListView.swift b/Projects/Features/LiveStreamFeature/Sources/Chating/Views/ChattingListView.swift index 36129bf1..9e37db45 100644 --- a/Projects/Features/LiveStreamFeature/Sources/Chating/Views/ChattingListView.swift +++ b/Projects/Features/LiveStreamFeature/Sources/Chating/Views/ChattingListView.swift @@ -65,7 +65,6 @@ final class ChattingListView: BaseView { titleLabel.font = .setFont(.body1()) chatListView.backgroundColor = .clear - chatListView.keyboardDismissMode = .onDrag chatListView.allowsSelection = false chatListView.separatorStyle = .none @@ -106,6 +105,9 @@ final class ChattingListView: BaseView { } override func setupActions() { + let tapGesture: UITapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(dismissKeyboard)) + self.addGestureRecognizer(tapGesture) + $isScrollFixed .debounce(for: .milliseconds(50), scheduler: DispatchQueue.main) .sink { [weak self] in @@ -153,6 +155,11 @@ final class ChattingListView: BaseView { self.layoutIfNeeded() } } + + @objc + private func dismissKeyboard() { + endEditing(true) + } } extension ChattingListView { diff --git a/Projects/Features/LiveStreamFeature/Sources/Player/ViewControllers/LiveStreamViewController.swift b/Projects/Features/LiveStreamFeature/Sources/Player/ViewControllers/LiveStreamViewController.swift index 93a83186..a63cffb2 100644 --- a/Projects/Features/LiveStreamFeature/Sources/Player/ViewControllers/LiveStreamViewController.swift +++ b/Projects/Features/LiveStreamFeature/Sources/Player/ViewControllers/LiveStreamViewController.swift @@ -159,6 +159,7 @@ public final class LiveStreamViewController: BaseViewController Date: Mon, 2 Dec 2024 23:13:26 +0900 Subject: [PATCH 2/4] =?UTF-8?q?fix=20=EC=B1=84=ED=8C=85=20=EA=B9=A8?= =?UTF-8?q?=EC=A7=80=EB=8A=94=20=EB=AC=B8=EC=A0=9C=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/Chating/Views/ChattingListView.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Projects/Features/LiveStreamFeature/Sources/Chating/Views/ChattingListView.swift b/Projects/Features/LiveStreamFeature/Sources/Chating/Views/ChattingListView.swift index 9e37db45..ef03053c 100644 --- a/Projects/Features/LiveStreamFeature/Sources/Chating/Views/ChattingListView.swift +++ b/Projects/Features/LiveStreamFeature/Sources/Chating/Views/ChattingListView.swift @@ -146,11 +146,11 @@ final class ChattingListView: BaseView { private func updateRecentChatButtonConstraint(isHidden: Bool) { UIView.animate(withDuration: 0.2) { if isHidden { - NSLayoutConstraint.activate(self.recentChatButtonHideConstraints) NSLayoutConstraint.deactivate(self.recentChatButtonShowConstraints) + NSLayoutConstraint.activate(self.recentChatButtonHideConstraints) } else { - NSLayoutConstraint.activate(self.recentChatButtonShowConstraints) NSLayoutConstraint.deactivate(self.recentChatButtonHideConstraints) + NSLayoutConstraint.activate(self.recentChatButtonShowConstraints) } self.layoutIfNeeded() } From 4dbd38d9238f8082ff27de5e602a90c2d6d41d02 Mon Sep 17 00:00:00 2001 From: "In Ye, Kim" Date: Mon, 2 Dec 2024 23:13:50 +0900 Subject: [PATCH 3/4] =?UTF-8?q?chore=20=EC=B1=84=ED=8C=85=20=EC=8A=A4?= =?UTF-8?q?=ED=81=AC=EB=A1=A4=20=EC=99=84=EB=A3=8C=EB=90=98=EB=A9=B4=20?= =?UTF-8?q?=EC=8A=A4=ED=81=AC=EB=A1=A4=20=EA=B3=84=EC=82=B0=ED=95=98?= =?UTF-8?q?=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/Chating/Views/ChattingListView.swift | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Projects/Features/LiveStreamFeature/Sources/Chating/Views/ChattingListView.swift b/Projects/Features/LiveStreamFeature/Sources/Chating/Views/ChattingListView.swift index ef03053c..3c9ff8f5 100644 --- a/Projects/Features/LiveStreamFeature/Sources/Chating/Views/ChattingListView.swift +++ b/Projects/Features/LiveStreamFeature/Sources/Chating/Views/ChattingListView.swift @@ -109,7 +109,6 @@ final class ChattingListView: BaseView { self.addGestureRecognizer(tapGesture) $isScrollFixed - .debounce(for: .milliseconds(50), scheduler: DispatchQueue.main) .sink { [weak self] in self?.updateRecentChatButtonConstraint(isHidden: $0) } @@ -137,9 +136,7 @@ final class ChattingListView: BaseView { } private func scrollToBottom() { - let lastRowIndex = chatListView.numberOfRows(inSection: 0) - 1 - guard lastRowIndex >= 0, - let indexPath = lastIndexPath() else { return } + guard let indexPath = lastIndexPath() else { return } chatListView.scrollToRow(at: indexPath, at: .bottom, animated: true) } @@ -183,7 +180,7 @@ extension ChattingListView: ChatInputFieldAction { } extension ChattingListView: UITableViewDelegate { - func scrollViewDidScroll(_ scrollView: UIScrollView) { + func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) { guard let lastIndexPath = lastIndexPath(), let indexPathList = chatListView.indexPathsForVisibleRows else { return } isScrollFixed = indexPathList.contains(lastIndexPath) From 91bcc5a89098bae8c9059a39d53e3c5267e0dc5f Mon Sep 17 00:00:00 2001 From: "In Ye, Kim" Date: Mon, 2 Dec 2024 23:32:21 +0900 Subject: [PATCH 4/4] =?UTF-8?q?fix=20=EB=B2=84=ED=8A=BC=20=ED=84=B0?= =?UTF-8?q?=EC=B9=98=20=EC=98=81=EC=97=AD=20=EB=84=93=ED=9E=88=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/Chating/Views/ChatInputField.swift | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Projects/Features/LiveStreamFeature/Sources/Chating/Views/ChatInputField.swift b/Projects/Features/LiveStreamFeature/Sources/Chating/Views/ChatInputField.swift index 8cc787d4..f229cfc4 100644 --- a/Projects/Features/LiveStreamFeature/Sources/Chating/Views/ChatInputField.swift +++ b/Projects/Features/LiveStreamFeature/Sources/Chating/Views/ChatInputField.swift @@ -130,6 +130,13 @@ final class ChatInputField: BaseView { heartButton.addTarget(self, action: #selector(didTapHeartButton), for: .touchUpInside) } + override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? { + if heartButton.bounds.insetBy(dx: -30, dy: -30).contains(point) { + return heartButton + } + return super.hitTest(point, with: event) + } + @objc private func didTapHeartButton() { let generator = UIImpactFeedbackGenerator(style: .light) @@ -142,7 +149,6 @@ final class ChatInputField: BaseView { self?.heartLayer.birthRate = 0 } layer.addSublayer(heartLayer) - } }