younger_times
2023-08-16 aec51d7dba8960905c0bfeb9e94689c96aeb721c
BrokerDriver/Base/BaseViewController.swift
@@ -35,21 +35,7 @@
    }
    func setRx(){
        NotificationCenter.default.rx.notification(UIDevice.orientationDidChangeNotification).take(until:self.rx.deallocated).subscribe {[weak self] _ in
            let orient = UIDevice.current.orientation
            var desc = ""
//            switch orient {
//                case .portrait :desc = Localized("屏幕正常竖向")
//                case .portraitUpsideDown:desc = Localized("屏幕倒立")
//                case .landscapeLeft:desc = Localized("屏幕左旋转")
//                case .landscapeRight:desc = Localized("屏幕右旋转")
//                default:break
//            }
            if !desc.isEmpty{
                self?.receiverNotification(orient: orient, desc: desc)
            }
        }.disposed(by: disposeBag)
    }
    func setUI(){
@@ -78,13 +64,6 @@
    deinit {
        LogInfo(String(format: "%@ 已释放", NSStringFromClass(self.classForCoder).components(separatedBy: ".").last!))
    }
    /// 屏幕旋转:当设备方向改变,需要对UI进行重新布局,子类重写此方法
    @objc open func receiverNotification(orient:UIDeviceOrientation,desc:String){
        LogInfo(desc)
        refreshUI()
    }
}