//
|
// GDTSDKDefines.h
|
// GDTMobApp
|
//
|
// Created by royqpwang on 2017/11/6.
|
// Copyright © 2017年 Tencent. All rights reserved.
|
//
|
|
#import <Foundation/Foundation.h>
|
|
#if defined(__has_attribute)
|
#if __has_attribute(deprecated)
|
#define GDT_DEPRECATED_MSG_ATTRIBUTE(s) __attribute__((deprecated(s)))
|
#define GDT_DEPRECATED_ATTRIBUTE __attribute__((deprecated))
|
#else
|
#define GDT_DEPRECATED_MSG_ATTRIBUTE(s)
|
#define GDT_DEPRECATED_ATTRIBUTE
|
#endif
|
#else
|
#define GDT_DEPRECATED_MSG_ATTRIBUTE(s)
|
#define GDT_DEPRECATED_ATTRIBUTE
|
#endif
|
|
#define ScreenHeight ([UIScreen mainScreen].bounds.size.height)
|
#define ScreenWidth ([UIScreen mainScreen].bounds.size.width)
|
|
#ifndef weakify
|
#if DEBUG
|
#if __has_feature(objc_arc)
|
#define weakify(object) autoreleasepool{} __weak __typeof__(object) weak##_##object = object;
|
#else
|
#define weakify(object) autoreleasepool{} __block __typeof__(object) block##_##object = object;
|
#endif
|
#else
|
#if __has_feature(objc_arc)
|
#define weakify(object) try{} @finally{} {} __weak __typeof__(object) weak##_##object = object;
|
#else
|
#define weakify(object) try{} @finally{} {} __block __typeof__(object) block##_##object = object;
|
#endif
|
#endif
|
#endif
|
|
#ifndef strongify
|
#if DEBUG
|
#if __has_feature(objc_arc)
|
#define strongify(object) autoreleasepool{} __typeof__(object) object = weak##_##object;
|
#else
|
#define strongify(object) autoreleasepool{} __typeof__(object) object = block##_##object;
|
#endif
|
#else
|
#if __has_feature(objc_arc)
|
#define strongify(object) try{} @finally{} __typeof__(object) object = weak##_##object;
|
#else
|
#define strongify(object) try{} @finally{} __typeof__(object) object = block##_##object;
|
#endif
|
#endif
|
#endif
|
|
static inline BOOL isIPhoneXSeries() {
|
if (@available(iOS 11.0, *)) {
|
UIWindow *mainWindow = [[[UIApplication sharedApplication] delegate] window];
|
if (mainWindow.safeAreaInsets.bottom > 0.0) {
|
return YES;
|
}
|
}
|
return NO;
|
}
|