//
//  UIWindow+DDCategory.m
//  DDCategoryKit_Private
//  Created by DDIsFriend on 2023/2/6.

#import "UIWindow+DDCategory.h"

@implementation UIWindow (DDCategory)
@dynamic dd_safeAreaTop;
@dynamic dd_safeAreaBottom;
@dynamic dd_safeAreaLeft;
@dynamic dd_safeAreaRight;

- (CGFloat)dd_safeAreaTop {
    if (@available(iOS 11.0, *)) {
        return self.safeAreaInsets.top;
    } else {
        return 0.0;
    }
}

- (CGFloat)dd_safeAreaBottom {
    if (@available(iOS 11.0, *)) {
        return self.safeAreaInsets.bottom;
    } else {
        return 0.0;
    }
}

- (CGFloat)dd_safeAreaLeft {
    if (@available(iOS 11.0, *)) {
        return self.safeAreaInsets.left;
    } else {
        return 0.0;
    }
}

- (CGFloat)dd_safeAreaRight {
    if (@available(iOS 11.0, *)) {
        return self.safeAreaInsets.right;
    } else {
        return 0.0;
    }
}
@end
