iOS: hasNotch implements
This commit is contained in:
@@ -42,3 +42,5 @@ NSBundle *_Nonnull DoricBundle(void);
|
||||
void ShowToast(NSString *_Nonnull text, DoricGravity gravity);
|
||||
|
||||
UIImage *_Nonnull UIImageWithColor(UIColor *_Nonnull color);
|
||||
|
||||
BOOL hasNotch(void);
|
||||
|
@@ -95,3 +95,12 @@ void ShowToast(NSString *text, DoricGravity gravity) {
|
||||
UIGraphicsEndImageContext();
|
||||
return image;
|
||||
}
|
||||
|
||||
BOOL hasNotch() {
|
||||
if (@available(iOS 11.0, *)) {
|
||||
CGFloat height = [[UIApplication sharedApplication] delegate].window.safeAreaInsets.bottom;
|
||||
return (height > 0);
|
||||
} else {
|
||||
return NO;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user