diff --git a/SwiftProject/SwiftProject.xcodeproj/project.pbxproj b/SwiftProject/SwiftProject.xcodeproj/project.pbxproj index 27ae8f7..4ca4e55 100644 --- a/SwiftProject/SwiftProject.xcodeproj/project.pbxproj +++ b/SwiftProject/SwiftProject.xcodeproj/project.pbxproj @@ -11,6 +11,7 @@ 005580782B9F1525004B9567 /* ZZHHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 005580772B9F1525004B9567 /* ZZHHelper.swift */; }; 009661F82BAD6C7100FCA65F /* CCSpaceAlbumFilterPopView2.swift in Sources */ = {isa = PBXBuildFile; fileRef = 009661F72BAD6C7100FCA65F /* CCSpaceAlbumFilterPopView2.swift */; }; 009661FA2BAD876200FCA65F /* PhotosUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 009661F92BAD876200FCA65F /* PhotosUI.framework */; }; + 009661FC2BADB20D00FCA65F /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 009661FB2BADB20D00FCA65F /* CoreMotion.framework */; }; 00B946232B67B26D00DA668F /* ddd_video.mp4 in Resources */ = {isa = PBXBuildFile; fileRef = 00B946222B67B26D00DA668F /* ddd_video.mp4 */; }; 00B946252B67B7DE00DA668F /* CCSpatialPlayView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00B946242B67B7DE00DA668F /* CCSpatialPlayView.swift */; }; 00C665732BAA81F900C309C3 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 00C665722BAA81F900C309C3 /* GoogleService-Info.plist */; }; @@ -101,6 +102,7 @@ 005580772B9F1525004B9567 /* ZZHHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ZZHHelper.swift; sourceTree = ""; }; 009661F72BAD6C7100FCA65F /* CCSpaceAlbumFilterPopView2.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CCSpaceAlbumFilterPopView2.swift; sourceTree = ""; }; 009661F92BAD876200FCA65F /* PhotosUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = PhotosUI.framework; path = System/Library/Frameworks/PhotosUI.framework; sourceTree = SDKROOT; }; + 009661FB2BADB20D00FCA65F /* CoreMotion.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMotion.framework; path = System/Library/Frameworks/CoreMotion.framework; sourceTree = SDKROOT; }; 00B946222B67B26D00DA668F /* ddd_video.mp4 */ = {isa = PBXFileReference; lastKnownFileType = file; path = ddd_video.mp4; sourceTree = ""; }; 00B946242B67B7DE00DA668F /* CCSpatialPlayView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CCSpatialPlayView.swift; sourceTree = ""; }; 00C665722BAA81F900C309C3 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = ""; }; @@ -203,6 +205,7 @@ AF2120D42B4E99FA00400B7F /* MobileCoreServices.framework in Frameworks */, 009661FA2BAD876200FCA65F /* PhotosUI.framework in Frameworks */, AF2120D62B4E9A0100400B7F /* Photos.framework in Frameworks */, + 009661FC2BADB20D00FCA65F /* CoreMotion.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -317,6 +320,7 @@ 4D8F3A411661D600CD07B39B /* Frameworks */ = { isa = PBXGroup; children = ( + 009661FB2BADB20D00FCA65F /* CoreMotion.framework */, 009661F92BAD876200FCA65F /* PhotosUI.framework */, 00EB2D042BA2D59000924D84 /* MessageUI.framework */, AF478B022B577D51005C35A5 /* AVFoundation.framework */, diff --git a/SwiftProject/SwiftProject.xcworkspace/xcuserdata/aaa.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/SwiftProject/SwiftProject.xcworkspace/xcuserdata/aaa.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist index e707470..64dcf29 100644 --- a/SwiftProject/SwiftProject.xcworkspace/xcuserdata/aaa.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +++ b/SwiftProject/SwiftProject.xcworkspace/xcuserdata/aaa.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -217,84 +217,6 @@ stopOnStyle = "0"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - = fabs(x)){ + + if deviceOrientation != 1 { + enableShutterBtn(false) + deviceOrientation = 1 + print("竖屏"); + autoStopRecordVideo() + showHorizontalScreenTips() + } + + } + else{ + + if deviceOrientation != 2 { + enableShutterBtn(true) + deviceOrientation = 2 + hidenHorizontalScreenTips() + print("横屏"); + } + } + + } + @objc fileprivate func orientationDidChange() { - switch UIDevice.current.orientation { - case .unknown: - print("未知") - case .portrait: - print("竖屏") - imageCGImagePropertyOrientation = .up - imageOrientation = .up - showHorizontalScreenTips() - case .portraitUpsideDown: - print("颠倒竖屏") - imageCGImagePropertyOrientation = .down - imageOrientation = .down - showHorizontalScreenTips() - case .landscapeLeft: - print("设备向左旋转横屏") - imageCGImagePropertyOrientation = .left - imageOrientation = .left - hidenHorizontalScreenTips() - case .landscapeRight: - print("设备向右旋转横屏") - imageCGImagePropertyOrientation = .right - imageOrientation = .right - hidenHorizontalScreenTips() - case .faceUp: - print("屏幕朝上") - case .faceDown: - print("屏幕朝下") - default: - break +// enableShutterBtn(false) +// switch UIDevice.current.orientation { +// case .unknown: +// print("未知") +// case .portrait: +// print("竖屏") +// imageCGImagePropertyOrientation = .up +// imageOrientation = .up +// +// autoStopRecordVideo() +// showHorizontalScreenTips() +// case .portraitUpsideDown: +// print("颠倒竖屏") +// autoStopRecordVideo() +// imageCGImagePropertyOrientation = .down +// imageOrientation = .down +// showHorizontalScreenTips() +// case .landscapeLeft: +// print("设备向左旋转横屏") +// imageCGImagePropertyOrientation = .left +// imageOrientation = .left +// hidenHorizontalScreenTips() +// enableShutterBtn(true) +// case .landscapeRight: +// print("设备向右旋转横屏") +// imageCGImagePropertyOrientation = .right +// imageOrientation = .right +// hidenHorizontalScreenTips() +// enableShutterBtn(true) +// case .faceUp: +// autoStopRecordVideo() +// print("屏幕朝上") +// case .faceDown: +// autoStopRecordVideo() +// print("屏幕朝下") +// default: +// break +// } + } + + //当屏幕转向发生改变时,自动结束录像 + func autoStopRecordVideo(){ + if self.isRecording { + stopRVideo() } } + + deinit { // 移除通知 - NotificationCenter.default.removeObserver(self, name: UIDevice.orientationDidChangeNotification, object: nil) - // 结束生成设备旋转方向通知 - UIDevice.current.endGeneratingDeviceOrientationNotifications() +// NotificationCenter.default.removeObserver(self, name: UIDevice.orientationDidChangeNotification, object: nil) +// // 结束生成设备旋转方向通知 +// UIDevice.current.endGeneratingDeviceOrientationNotifications() if let timer = self.timer { // 当视图控制器被释放时,取消定时器