cdts/xdts-ios 3/TreeHole/CYHResetCode/CYH/QMUIKit/UIKitExtensions/UIInterface+QMUI.h

74 lines
4.2 KiB
C
Raw Permalink Normal View History

2023-07-27 09:20:00 +08:00
/**
* Tencent is pleased to support the open source community by making QMUI_iOS available.
* Copyright (C) 2016-2021 THL A29 Limited, a Tencent company. All rights reserved.
* Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
* http://opensource.org/licenses/MIT
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
*/
//
// UIInterface+QMUI.h
// QMUIKit
//
// Created by QMUI Team on 2018/12/20.
//
#import <UIKit/UIKit.h>
#import "QMUIHelper.h"
NS_ASSUME_NONNULL_BEGIN
@interface QMUIHelper (QMUI_Interface)
/**
* 使 UIDeviceOrientationUnknown UIDeviceOrientationUnknown
*/
@property(nonatomic, assign) UIDeviceOrientation lastOrientationChangedByHelper;
/// 将一个 UIInterfaceOrientationMask 转换成对应的 UIDeviceOrientation
+ (UIDeviceOrientation)deviceOrientationWithInterfaceOrientationMask:(UIInterfaceOrientationMask)mask;
/// 判断一个 UIInterfaceOrientationMask 是否包含某个给定的 UIDeviceOrientation 方向
+ (BOOL)interfaceOrientationMask:(UIInterfaceOrientationMask)mask containsDeviceOrientation:(UIDeviceOrientation)deviceOrientation;
/// 判断一个 UIInterfaceOrientationMask 是否包含某个给定的 UIInterfaceOrientation 方向
+ (BOOL)interfaceOrientationMask:(UIInterfaceOrientationMask)mask containsInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation;
/// 根据指定的旋转方向计算出对应的旋转角度
+ (CGFloat)angleForTransformWithInterfaceOrientation:(UIInterfaceOrientation)orientation;
/// 根据当前设备的旋转方向计算出对应的CGAffineTransform
+ (CGAffineTransform)transformForCurrentInterfaceOrientation;
/// 根据指定的旋转方向计算出对应的CGAffineTransform
+ (CGAffineTransform)transformWithInterfaceOrientation:(UIInterfaceOrientation)orientation;
/// 给 QMUIHelper instance 通知用
- (void)handleDeviceOrientationNotification:(NSNotification *)notification;
@end
@interface UIViewController (QMUI_Interface)
/**
-[UIViewController supportedInterfaceOrientations]
@return YES NO
@note @c qmui_setNeedsUpdateOfSupportedInterfaceOrientations N个方向N个方向的支持的情况下把设备方向旋转为这N个方向里的某一个时 @c qmui_rotateToInterfaceOrientation: N个方向N换成M并触发设备的方向刷新 @c qmui_setNeedsUpdateOfSupportedInterfaceOrientations https://github.com/Tencent/QMUI_iOS/wiki/%E9%80%82%E7%94%A8%E4%BA%8E-iOS-16-%E5%8F%8A%E4%BB%A5%E4%B8%8B%E7%89%88%E6%9C%AC%E7%9A%84%E5%B1%8F%E5%B9%95%E6%96%B9%E5%90%91%E6%8E%A7%E5%88%B6%E6%96%B9%E5%BC%8F
*/
- (BOOL)qmui_rotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation;
/**
-[UIViewController supportedInterfaceOrientations] iOS 16
*/
- (void)qmui_setNeedsUpdateOfSupportedInterfaceOrientations;
/**
AutomaticallyRotateDeviceOrientation QMUI UIViewController QMUI UIViewController YES
NO QMUI
@warning iOS 15 iOS 16 QMUI
*/
- (BOOL)qmui_shouldForceRotateDeviceOrientation;
@end
NS_ASSUME_NONNULL_END