From a61e3fc2d3cfb86f9a7310affb46d05a230fc297 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cihat=20Gu=CC=88ndu=CC=88z?= Date: Sun, 31 Oct 2021 14:33:46 +0100 Subject: [PATCH] Replace deprecated AirPlay chooser with modern to fix light mode issue --- .../ScreenFlows/Settings/AudioVolumeView.swift | 12 ++---------- Prayer.xcodeproj/project.pbxproj | 4 ++-- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/App/Sources/ScreenFlows/Settings/AudioVolumeView.swift b/App/Sources/ScreenFlows/Settings/AudioVolumeView.swift index b4944c1..bedef2b 100644 --- a/App/Sources/ScreenFlows/Settings/AudioVolumeView.swift +++ b/App/Sources/ScreenFlows/Settings/AudioVolumeView.swift @@ -5,18 +5,17 @@ import AVKit import UIKit -import MediaPlayer import HandyUIKit class AudioVolumeView: UIView { private let currentPortLabel: UILabel - private let deviceChooserButton: MPVolumeView + private let deviceChooserButton: AVRoutePickerView override init( frame: CGRect ) { deviceChooserButton = .init(frame: .init(x: 36, y: 0, width: 25, height: frame.height)) - deviceChooserButton.showsVolumeSlider = false + deviceChooserButton.prioritizesVideoDevices = false currentPortLabel = .init(frame: .init(size: frame.size)) currentPortLabel.textColor = .secondaryLabel @@ -30,13 +29,6 @@ class AudioVolumeView: UIView { updateCurrentPortLabel() subscribeToRouteChangeNotification() - - #if targetEnvironment(simulator) - let imageView = UIImageView(image: UIImage(systemName: "airplayvideo")) - imageView.contentMode = .scaleAspectFit - deviceChooserButton.addSubview(imageView) - imageView.bindEdgesToSuperview() - #endif } required init?( diff --git a/Prayer.xcodeproj/project.pbxproj b/Prayer.xcodeproj/project.pbxproj index df8062c..e2de109 100644 --- a/Prayer.xcodeproj/project.pbxproj +++ b/Prayer.xcodeproj/project.pbxproj @@ -1531,7 +1531,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; - CURRENT_PROJECT_VERSION = 1; + CURRENT_PROJECT_VERSION = 2; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = 767S6EFMJ8; INFOPLIST_FILE = "$(SRCROOT)/App/SupportingFiles/Info.plist"; @@ -1552,7 +1552,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; - CURRENT_PROJECT_VERSION = 1; + CURRENT_PROJECT_VERSION = 2; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = 767S6EFMJ8; INFOPLIST_FILE = "$(SRCROOT)/App/SupportingFiles/Info.plist";