WidgetKitHelper.swift
import WidgetKit
@available(iOS 14.0, *)
@objcMembers final class WidgetKitHelper: NSObject {
class func reloadAllWidgets(){
#if arch(arm64) || arch(i386) || arch(x86_64)
WidgetCenter.shared.reloadAllTimelines()
#endif
}
}
#import "Product name-Swift.h"
if (@available(iOS 14.0, *)) {
[WidgetKitHelper reloadAllWidgets];
}
- (void)applicationDidEnterBackground:(UIApplication *)application {
if (@available(iOS 14.0, *)) {
[WidgetKitHelper reloadAllWidgets];
}
}
Recommended Posts