简单判断iPhone X以后的机型

+(BOOL)isiPhoneXLater{
    if (@available(iOS 11.0, *)) {
        return UIApplication.sharedApplication.keyWindow.safeAreaInsets.bottom > 0.0 ? true : false;
    } else {
        return  false;
    }
}

可以将方法调用写到自定义宏中,嗯,其实就这么简单

你可能感兴趣的:(简单判断iPhone X以后的机型)