From e7f00664cd36244695bdd98b5897159eed2592bd Mon Sep 17 00:00:00 2001 From: Burrit0z Date: Fri, 25 Sep 2020 13:25:40 -0400 Subject: [PATCH] fix ios 14.0.1 crash (temp fix) --- KAIBatteryCell.mm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/KAIBatteryCell.mm b/KAIBatteryCell.mm index 786d9e9..189a972 100755 --- a/KAIBatteryCell.mm +++ b/KAIBatteryCell.mm @@ -16,7 +16,11 @@ UIView *blurPlatter = [[UIView alloc] init]; if (bannerStyle == 1) { if (kCFCoreFoundationVersionNumber > 1600) { - blur = [[[objc_getClass("MTMaterialView") class] alloc] _initWithRecipe:1 configuration:1 initialWeighting:1 scaleAdjustment:nil]; + @try { + blur = [[[objc_getClass("MTMaterialView") class] alloc] _initWithRecipe:1 configuration:1 initialWeighting:1 scaleAdjustment:nil]; + } @catch (NSException *exc) { + blur = [[UIVisualEffectView alloc] initWithEffect:[UIBlurEffect effectWithStyle:UIBlurEffectStyleRegular]]; + } } else if (kCFCoreFoundationVersionNumber < 1600) { blur = [[UIVisualEffectView alloc] initWithEffect:[UIBlurEffect effectWithStyle:UIBlurEffectStyleLight]]; }