WidgetKit获取用户添加了那些widget
WidgetCenter.shared.getCurrentConfigurations { result in
switch result {
case let .success(widgets):
print("添加了\(widgets.count)个Widget")
widgets.forEach { widget in
print(widget.kind)
}
case let .failure(error):
print(error)
}
}