From d3dccae0f11267f34ec5919fa889289aacfaea89 Mon Sep 17 00:00:00 2001 From: ryanzhao Date: Wed, 30 Nov 2022 13:31:18 +1100 Subject: [PATCH] feat: make the whole conversation title view scrollable --- .../Views & Modals/ConversationTitleView.swift | 6 ++++++ .../Views & Modals/SessionLabelCarouselView.swift | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Session/Conversations/Views & Modals/ConversationTitleView.swift b/Session/Conversations/Views & Modals/ConversationTitleView.swift index 66f79e847..b872bb69a 100644 --- a/Session/Conversations/Views & Modals/ConversationTitleView.swift +++ b/Session/Conversations/Views & Modals/ConversationTitleView.swift @@ -239,4 +239,10 @@ final class ConversationTitleView: UIView { ) self.stackViewTrailingConstraint.constant = 0 } + + // MARK: - Interaction + + override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? { + return self.labelCarouselView.scrollView + } } diff --git a/Session/Conversations/Views & Modals/SessionLabelCarouselView.swift b/Session/Conversations/Views & Modals/SessionLabelCarouselView.swift index f3b74bdf8..ffcaea072 100644 --- a/Session/Conversations/Views & Modals/SessionLabelCarouselView.swift +++ b/Session/Conversations/Views & Modals/SessionLabelCarouselView.swift @@ -37,7 +37,7 @@ final class SessionLabelCarouselView: UIView, UIScrollViewDelegate { // MARK: - UI Components - private lazy var scrollView: UIScrollView = { + public lazy var scrollView: UIScrollView = { let result = UIScrollView(frame: .zero) result.isPagingEnabled = true result.showsVerticalScrollIndicator = false @@ -164,6 +164,8 @@ final class SessionLabelCarouselView: UIView, UIScrollViewDelegate { scrollView.addSubview(stackView) } + // MARK: - Interaction + private func startScrolling() { timer?.invalidate() timer = Timer.scheduledTimerOnMainThread(withTimeInterval: Self.autoScrollingTimeInterval, repeats: true) { _ in