WidgetKit获取用户添加了那些widget

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)
            }
        }

你可能感兴趣的:(WidgetKit获取用户添加了那些widget)