WidgetKit获取用户添加了那些widget

2022-03-10  本文已影响0人  Mr_ZNN

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)
            }
        }
上一篇 下一篇

猜你喜欢

热点阅读