You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

60 lines
2.8 KiB

/**
* Tencent is pleased to support the open source community by making QMUI_iOS available.
* Copyright (C) 2016-2020 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)
/**
* [UIViewController supportedInterfaceOrientations]
* @return YES NO
* @see [QMUIConfiguration automaticallyRotateDeviceOrientation]
*/
+ (BOOL)rotateToDeviceOrientation:(UIDeviceOrientation)orientation;
/**
* UIDeviceOrientationUnknown UIDeviceOrientationUnknown
* @see [QMUIHelper rotateToDeviceOrientation]
*/
@property(nonatomic, assign) UIDeviceOrientation orientationBeforeChangingByHelper;
/// 将一个 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
NS_ASSUME_NONNULL_END