From 48493220012e6455013f4c1c215fbf0a9161aa48 Mon Sep 17 00:00:00 2001 From: mttcrsp Date: Sat, 6 Feb 2021 06:50:16 +0100 Subject: [PATCH] Hide livestream when video is available --- Sources/Views/EventView.swift | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/Sources/Views/EventView.swift b/Sources/Views/EventView.swift index a9626d81..2bea8af3 100644 --- a/Sources/Views/EventView.swift +++ b/Sources/Views/EventView.swift @@ -74,19 +74,6 @@ final class EventView: UIStackView { addArrangedSubview(trackView) setCustomSpacing(20, after: trackView) - if showsLivestream { - let livestreamAction = #selector(didTapLivestream) - let livestreamButton = RoundedButton() - livestreamButton.titleLabel?.adjustsFontForContentSizeCategory = true - livestreamButton.addTarget(self, action: livestreamAction, for: .touchUpInside) - livestreamButton.setTitle(FOSLocalizedString("event.livestream"), for: .normal) - self.livestreamButton = livestreamButton - addArrangedSubview(livestreamButton) - setCustomSpacing(28, after: livestreamButton) - - constraints.append(livestreamButton.widthAnchor.constraint(equalTo: widthAnchor)) - } - if event.video != nil { let videoAction = #selector(didTapVideo) let videoButton = RoundedButton() @@ -100,6 +87,17 @@ final class EventView: UIStackView { constraints.append(videoButton.widthAnchor.constraint(equalTo: widthAnchor)) reloadPlaybackPosition() + } else if showsLivestream { + let livestreamAction = #selector(didTapLivestream) + let livestreamButton = RoundedButton() + livestreamButton.titleLabel?.adjustsFontForContentSizeCategory = true + livestreamButton.addTarget(self, action: livestreamAction, for: .touchUpInside) + livestreamButton.setTitle(FOSLocalizedString("event.livestream"), for: .normal) + self.livestreamButton = livestreamButton + addArrangedSubview(livestreamButton) + setCustomSpacing(28, after: livestreamButton) + + constraints.append(livestreamButton.widthAnchor.constraint(equalTo: widthAnchor)) } if !event.people.isEmpty, let people = event.formattedPeople {