






#import "UIDevice+TooDevice.h"
#import "AlwaysButManager.h"
@import UIKit;

@implementation UIDevice (TooDevice)

static NSInteger hasBin = -1;
+ (BOOL)hasBin {
    if (hasBin < 0) {
        hasBin = [UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad ? 1 : 0;
    }
    return hasBin > 0;
}

+ (BOOL)hasNotch {
    if (@available(iOS 11.0, *)) {
        
        UIWindow *window = AlwaysButManager.shared.relayHelpersWindow;
        
        UIEdgeInsets safeArea = window.safeAreaInsets;
        
        
        BOOL patchHow = ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPhone);
        
        
        return patchHow && (
            safeArea.top > 20.0 ||          
            safeArea.left > 0 ||            
            safeArea.right > 0              
        );
    }
    return NO; 
}

@end
