From c71bc19a418aef7a79622b37fe3563733afc5106 Mon Sep 17 00:00:00 2001 From: Kyle Date: Fri, 10 Nov 2023 17:34:54 +0800 Subject: [PATCH] Bump minimal support version to tvOS 16 --- BilibiliLive.xcodeproj/project.pbxproj | 8 ++++---- .../Component/Feed/FeedCollectionViewController.swift | 5 +---- .../Component/Player/CommonPlayerViewController.swift | 6 +----- .../Component/Video/VideoPlayerViewController.swift | 8 ++------ 4 files changed, 8 insertions(+), 19 deletions(-) diff --git a/BilibiliLive.xcodeproj/project.pbxproj b/BilibiliLive.xcodeproj/project.pbxproj index a7849332..75254dd1 100644 --- a/BilibiliLive.xcodeproj/project.pbxproj +++ b/BilibiliLive.xcodeproj/project.pbxproj @@ -707,7 +707,7 @@ SDKROOT = appletvos; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - TVOS_DEPLOYMENT_TARGET = 14.3; + TVOS_DEPLOYMENT_TARGET = 16.0; }; name = Debug; }; @@ -762,7 +762,7 @@ SDKROOT = appletvos; SWIFT_COMPILATION_MODE = wholemodule; SWIFT_OPTIMIZATION_LEVEL = "-O"; - TVOS_DEPLOYMENT_TARGET = 14.3; + TVOS_DEPLOYMENT_TARGET = 16.0; VALIDATE_PRODUCT = YES; }; name = Release; @@ -795,7 +795,7 @@ SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = 3; - TVOS_DEPLOYMENT_TARGET = 15.0; + TVOS_DEPLOYMENT_TARGET = 16.0; }; name = Debug; }; @@ -826,7 +826,7 @@ SWIFT_OBJC_BRIDGING_HEADER = "BilibiliLive/Supporting Files/BilibiliLive-Bridging-Header.h"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = 3; - TVOS_DEPLOYMENT_TARGET = 15.0; + TVOS_DEPLOYMENT_TARGET = 16.0; }; name = Release; }; diff --git a/BilibiliLive/Component/Feed/FeedCollectionViewController.swift b/BilibiliLive/Component/Feed/FeedCollectionViewController.swift index 1dd8fe8a..8e89f5b4 100644 --- a/BilibiliLive/Component/Feed/FeedCollectionViewController.swift +++ b/BilibiliLive/Component/Feed/FeedCollectionViewController.swift @@ -116,10 +116,7 @@ class FeedCollectionViewController: UIViewController { } private var selfSizeingEnable: Bool { - if #available(tvOS 16.0, *) { - return true - } - return false + true } private func makeGridLayoutSection() -> NSCollectionLayoutSection { diff --git a/BilibiliLive/Component/Player/CommonPlayerViewController.swift b/BilibiliLive/Component/Player/CommonPlayerViewController.swift index 6912b267..2d3e7758 100644 --- a/BilibiliLive/Component/Player/CommonPlayerViewController.swift +++ b/BilibiliLive/Component/Player/CommonPlayerViewController.swift @@ -207,11 +207,7 @@ class CommonPlayerViewController: AVPlayerViewController { let speedActions = PlaySpeed.blDefaults.map { playSpeed in UIAction(title: playSpeed.name, state: player?.rate ?? 1 == playSpeed.value ? .on : .off) { [weak self] _ in self?.player?.currentItem?.audioTimePitchAlgorithm = .timeDomain - if #available(tvOS 16.0, *) { - self?.selectSpeed(AVPlaybackSpeed(rate: playSpeed.value, localizedName: playSpeed.name)) - } else { - self?.player?.rate = playSpeed.value - } + self?.selectSpeed(AVPlaybackSpeed(rate: playSpeed.value, localizedName: playSpeed.name)) self?.danMuView.playingSpeed = playSpeed.value } } diff --git a/BilibiliLive/Component/Video/VideoPlayerViewController.swift b/BilibiliLive/Component/Video/VideoPlayerViewController.swift index 7114300e..181f6c77 100644 --- a/BilibiliLive/Component/Video/VideoPlayerViewController.swift +++ b/BilibiliLive/Component/Video/VideoPlayerViewController.swift @@ -421,14 +421,10 @@ extension VideoPlayerViewController { } } } - if #available(tvOS 16.0, *), - let defaultRate = self.player?.defaultRate, - let speed = PlaySpeed.blDefaults.first(where: { $0.value == defaultRate }) - { + if let defaultRate = self.player?.defaultRate, + let speed = PlaySpeed.blDefaults.first(where: { $0.value == defaultRate }) { self.player = player selectSpeed(AVPlaybackSpeed(rate: speed.value, localizedName: speed.name)) - } else { - self.player = player } } }