From: liangzhenying <867174124@qq.com> Date: Sat, 28 Feb 2026 08:49:14 +0000 (+0800) Subject: iOS26侧滑优化 X-Git-Url: http://git.snicker.com.cn/?a=commitdiff_plain;h=9e95f48f2ad67f617be61c67ee48772f8f259d70;p=mirrors%2FShenYin.git iOS26侧滑优化 --- diff --git a/ShenYin/ShenYin/Sdk/DcSdk/VC/AiFunctionVC.swift b/ShenYin/ShenYin/Sdk/DcSdk/VC/AiFunctionVC.swift index 1d67bf2..5c1787e 100644 --- a/ShenYin/ShenYin/Sdk/DcSdk/VC/AiFunctionVC.swift +++ b/ShenYin/ShenYin/Sdk/DcSdk/VC/AiFunctionVC.swift @@ -107,9 +107,11 @@ fileprivate class AiFunctionHeadView: BaseView { didSet{ if enable { icon.connetedView.isHidden = false + bottonView.alpha = 1 } else{ icon.connetedView.isHidden = true + bottonView.alpha = 0.5 } } } diff --git a/ShenYin/ShenYin/Sdk/DcSdk/VC/DcChinese2EnglishVC.swift b/ShenYin/ShenYin/Sdk/DcSdk/VC/DcChinese2EnglishVC.swift index a50b38c..edc8d08 100644 --- a/ShenYin/ShenYin/Sdk/DcSdk/VC/DcChinese2EnglishVC.swift +++ b/ShenYin/ShenYin/Sdk/DcSdk/VC/DcChinese2EnglishVC.swift @@ -73,14 +73,14 @@ class DcChinese2EnglishVC:BaseVC{ } override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) - navigationController?.fd_fullscreenPopGestureRecognizer?.isEnabled = false + disablePopGesture() PcmSound.sharedInstance().delegate = sdk CCAiManager.preparePlayBlueTooth() } override func viewDidDisappear(_ animated: Bool) { super.viewDidDisappear(animated) - navigationController?.fd_fullscreenPopGestureRecognizer?.isEnabled = true + enablePopGesture() CCAiManager.preparePlayBlueTooth() } override func navleftViewTapped() { diff --git a/ShenYin/ShenYin/Sdk/DcSdk/VC/DcDialogTranslateVC.swift b/ShenYin/ShenYin/Sdk/DcSdk/VC/DcDialogTranslateVC.swift index c763011..f8a106e 100644 --- a/ShenYin/ShenYin/Sdk/DcSdk/VC/DcDialogTranslateVC.swift +++ b/ShenYin/ShenYin/Sdk/DcSdk/VC/DcDialogTranslateVC.swift @@ -84,11 +84,11 @@ class DcDialogTranslateVC:BaseVC{ } override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) - navigationController?.fd_fullscreenPopGestureRecognizer?.isEnabled = false + disablePopGesture() } override func viewDidDisappear(_ animated: Bool) { super.viewDidDisappear(animated) - navigationController?.fd_fullscreenPopGestureRecognizer?.isEnabled = true + enablePopGesture() } override func navleftViewTapped() { CCAiManager.stopPlay() diff --git a/ShenYin/ShenYin/Sdk/DcSdk/VC/DcStereoCallVC.swift b/ShenYin/ShenYin/Sdk/DcSdk/VC/DcStereoCallVC.swift index d240c47..6f78a3f 100644 --- a/ShenYin/ShenYin/Sdk/DcSdk/VC/DcStereoCallVC.swift +++ b/ShenYin/ShenYin/Sdk/DcSdk/VC/DcStereoCallVC.swift @@ -171,11 +171,11 @@ class DcStereoCallVC:BaseVC{ } override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) - navigationController?.fd_fullscreenPopGestureRecognizer?.isEnabled = false + disablePopGesture() } override func viewDidDisappear(_ animated: Bool) { super.viewDidDisappear(animated) - navigationController?.fd_fullscreenPopGestureRecognizer?.isEnabled = true + enablePopGesture() } override func navleftViewTapped() { if toolBar.recordBtn.isSelected { diff --git a/ShenYin/ShenYin/Sdk/DcSdk/VC/DcTctyVC.swift b/ShenYin/ShenYin/Sdk/DcSdk/VC/DcTctyVC.swift index 3c04a30..ea5d862 100644 --- a/ShenYin/ShenYin/Sdk/DcSdk/VC/DcTctyVC.swift +++ b/ShenYin/ShenYin/Sdk/DcSdk/VC/DcTctyVC.swift @@ -117,14 +117,14 @@ class DcTctyVC:BaseVC{ override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) - navigationController?.fd_fullscreenPopGestureRecognizer?.isEnabled = false + disablePopGesture() PcmSound.sharedInstance().delegate = sdk CCAiManager.preparePlayBlueTooth() } override func viewDidDisappear(_ animated: Bool) { super.viewDidDisappear(animated) - navigationController?.fd_fullscreenPopGestureRecognizer?.isEnabled = true + enablePopGesture() CCAiManager.stopPlay() } override func navleftViewTapped() { diff --git a/ShenYin/ShenYin/Sdk/DcSdk/VC/DcXclyVC.swift b/ShenYin/ShenYin/Sdk/DcSdk/VC/DcXclyVC.swift index 434a261..07c055c 100644 --- a/ShenYin/ShenYin/Sdk/DcSdk/VC/DcXclyVC.swift +++ b/ShenYin/ShenYin/Sdk/DcSdk/VC/DcXclyVC.swift @@ -119,11 +119,11 @@ class DcXclyVC:BaseVC{ } override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) - navigationController?.fd_fullscreenPopGestureRecognizer?.isEnabled = false + disablePopGesture() } override func viewDidDisappear(_ animated: Bool) { super.viewDidDisappear(animated) - navigationController?.fd_fullscreenPopGestureRecognizer?.isEnabled = true + enablePopGesture() } override func navleftViewTapped() { if toolBar.recordBtn.isSelected { diff --git a/ShenYin/ShenYin/Sdk/JoySdk/VC/JoyCallingRecordVC.swift b/ShenYin/ShenYin/Sdk/JoySdk/VC/JoyCallingRecordVC.swift index 29e4bba..9e98d2f 100644 --- a/ShenYin/ShenYin/Sdk/JoySdk/VC/JoyCallingRecordVC.swift +++ b/ShenYin/ShenYin/Sdk/JoySdk/VC/JoyCallingRecordVC.swift @@ -130,11 +130,11 @@ class JoyCallingRecordVC:BaseVC{ override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) - navigationController?.fd_fullscreenPopGestureRecognizer?.isEnabled = false + disablePopGesture() } override func viewDidDisappear(_ animated: Bool) { super.viewDidDisappear(animated) - navigationController?.fd_fullscreenPopGestureRecognizer?.isEnabled = true + enablePopGesture() } override func navleftViewTapped() { if toolBar.recordBtn.isSelected { diff --git a/ShenYin/ShenYin/Sdk/JoySdk/VC/JoyChinese2EnglishVC.swift b/ShenYin/ShenYin/Sdk/JoySdk/VC/JoyChinese2EnglishVC.swift index f8e9bfe..1bdb328 100644 --- a/ShenYin/ShenYin/Sdk/JoySdk/VC/JoyChinese2EnglishVC.swift +++ b/ShenYin/ShenYin/Sdk/JoySdk/VC/JoyChinese2EnglishVC.swift @@ -73,14 +73,14 @@ class JoyChinese2EnglishVC:BaseVC{ } override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) - navigationController?.fd_fullscreenPopGestureRecognizer?.isEnabled = false + disablePopGesture() PcmSound.sharedInstance().delegate = sdk CCAiManager.preparePlayBlueTooth() } override func viewDidDisappear(_ animated: Bool) { super.viewDidDisappear(animated) - navigationController?.fd_fullscreenPopGestureRecognizer?.isEnabled = true + enablePopGesture() CCAiManager.preparePlayBlueTooth() } override func navleftViewTapped() { diff --git a/ShenYin/ShenYin/Sdk/JoySdk/VC/JoyDialogTranlateVC.swift b/ShenYin/ShenYin/Sdk/JoySdk/VC/JoyDialogTranlateVC.swift index 5fde931..c8fb86a 100644 --- a/ShenYin/ShenYin/Sdk/JoySdk/VC/JoyDialogTranlateVC.swift +++ b/ShenYin/ShenYin/Sdk/JoySdk/VC/JoyDialogTranlateVC.swift @@ -86,11 +86,11 @@ class JoyDialogTranslateVC:BaseVC{ } override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) - navigationController?.fd_fullscreenPopGestureRecognizer?.isEnabled = false + disablePopGesture() } override func viewDidDisappear(_ animated: Bool) { super.viewDidDisappear(animated) - navigationController?.fd_fullscreenPopGestureRecognizer?.isEnabled = true + enablePopGesture() } override func navleftViewTapped() { JoyGemSIManager.shared().stop() diff --git a/ShenYin/ShenYin/Sdk/JoySdk/VC/JoyStereoCallVC.swift b/ShenYin/ShenYin/Sdk/JoySdk/VC/JoyStereoCallVC.swift index 886600f..dba5d8d 100644 --- a/ShenYin/ShenYin/Sdk/JoySdk/VC/JoyStereoCallVC.swift +++ b/ShenYin/ShenYin/Sdk/JoySdk/VC/JoyStereoCallVC.swift @@ -176,11 +176,11 @@ class JoyStereoCallVC:BaseVC{ } override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) - navigationController?.fd_fullscreenPopGestureRecognizer?.isEnabled = false + disablePopGesture() } override func viewDidDisappear(_ animated: Bool) { super.viewDidDisappear(animated) - navigationController?.fd_fullscreenPopGestureRecognizer?.isEnabled = true + enablePopGesture() } override func navleftViewTapped() { if toolBar.recordBtn.isSelected { diff --git a/ShenYin/ShenYin/Sdk/JoySdk/VC/JoyTctyVC.swift b/ShenYin/ShenYin/Sdk/JoySdk/VC/JoyTctyVC.swift index cd98e53..8b3fa25 100644 --- a/ShenYin/ShenYin/Sdk/JoySdk/VC/JoyTctyVC.swift +++ b/ShenYin/ShenYin/Sdk/JoySdk/VC/JoyTctyVC.swift @@ -118,14 +118,14 @@ class JoyTctyVC:BaseVC{ override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) - navigationController?.fd_fullscreenPopGestureRecognizer?.isEnabled = false + disablePopGesture() PcmSound.sharedInstance().delegate = sdk CCAiManager.preparePlayBlueTooth() } override func viewDidDisappear(_ animated: Bool) { super.viewDidDisappear(animated) - navigationController?.fd_fullscreenPopGestureRecognizer?.isEnabled = true + enablePopGesture() CCAiManager.stopPlay() } override func navleftViewTapped() { diff --git a/ShenYin/ShenYin/Sdk/JoySdk/VC/JoyXclyVC.swift b/ShenYin/ShenYin/Sdk/JoySdk/VC/JoyXclyVC.swift index 8a9662e..f583f0b 100644 --- a/ShenYin/ShenYin/Sdk/JoySdk/VC/JoyXclyVC.swift +++ b/ShenYin/ShenYin/Sdk/JoySdk/VC/JoyXclyVC.swift @@ -109,11 +109,11 @@ class JoyXclyVC:BaseVC{ } override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) - navigationController?.fd_fullscreenPopGestureRecognizer?.isEnabled = false + disablePopGesture() } override func viewDidDisappear(_ animated: Bool) { super.viewDidDisappear(animated) - navigationController?.fd_fullscreenPopGestureRecognizer?.isEnabled = true + enablePopGesture() } override func navleftViewTapped() { if toolBar.recordBtn.isSelected { diff --git a/ShenYin/ShenYin/UI/Base/BaseNC.swift b/ShenYin/ShenYin/UI/Base/BaseNC.swift index 525bc4c..e33c1f7 100644 --- a/ShenYin/ShenYin/UI/Base/BaseNC.swift +++ b/ShenYin/ShenYin/UI/Base/BaseNC.swift @@ -11,12 +11,22 @@ import FDFullscreenPopGesture class BaseNC: UINavigationController { override init(rootViewController: UIViewController) { super.init(rootViewController: rootViewController) - fd_fullscreenPopGestureRecognizer?.isEnabled = true + navigationController?.fd_fullscreenPopGestureRecognizer?.isEnabled = true + if #available(iOS 26.0, *) { + navigationController?.interactiveContentPopGestureRecognizer?.isEnabled = true + } else { + // Fallback on earlier versions + } } required init?(coder aDecoder: NSCoder) { super.init(coder: aDecoder) - fd_fullscreenPopGestureRecognizer?.isEnabled = true + navigationController?.fd_fullscreenPopGestureRecognizer?.isEnabled = true + if #available(iOS 26.0, *) { + navigationController?.interactiveContentPopGestureRecognizer?.isEnabled = true + } else { + // Fallback on earlier versions + } } override var preferredStatusBarStyle: UIStatusBarStyle { return topViewController?.preferredStatusBarStyle ?? .lightContent diff --git a/ShenYin/ShenYin/UI/Base/BaseVC.swift b/ShenYin/ShenYin/UI/Base/BaseVC.swift index 8450388..d286523 100644 --- a/ShenYin/ShenYin/UI/Base/BaseVC.swift +++ b/ShenYin/ShenYin/UI/Base/BaseVC.swift @@ -96,6 +96,22 @@ open class BaseVC:UIViewController { @objc func logAction(){ App.shared.goToPage(LogVC()) } + func enablePopGesture(){ + navigationController?.fd_fullscreenPopGestureRecognizer?.isEnabled = true + if #available(iOS 26.0, *) { + navigationController?.interactiveContentPopGestureRecognizer?.isEnabled = true + } else { + // Fallback on earlier versions + } + } + func disablePopGesture(){ + navigationController?.fd_fullscreenPopGestureRecognizer?.isEnabled = false + if #available(iOS 26.0, *) { + navigationController?.interactiveContentPopGestureRecognizer?.isEnabled = false + } else { + // Fallback on earlier versions + } + } } extension BaseVC: BaseNavigationBarDelegate { diff --git a/ShenYin/ShenYin/UI/Login/Controller/Binding/BindingPhoneVC.swift b/ShenYin/ShenYin/UI/Login/Controller/Binding/BindingPhoneVC.swift index 7c9a8c7..f13a589 100644 --- a/ShenYin/ShenYin/UI/Login/Controller/Binding/BindingPhoneVC.swift +++ b/ShenYin/ShenYin/UI/Login/Controller/Binding/BindingPhoneVC.swift @@ -63,13 +63,13 @@ class BindingPhoneVC:BaseVC{ override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) if isBingding{ - navigationController?.fd_fullscreenPopGestureRecognizer?.isEnabled = false + disablePopGesture() } } override func viewDidDisappear(_ animated: Bool) { super.viewDidDisappear(animated) if isBingding{ - navigationController?.fd_fullscreenPopGestureRecognizer?.isEnabled = true + enablePopGesture() } } // override func navRightViewTapped() {