如何在iOS应用程序上清除安装的小部件

发布于 2025-02-02 03:10:13 字数 173 浏览 3 评论 0原文

在iOS应用的最后版本中,我们实现了窗口小部件功能,但是在即将发布的版本中,我们决定删除窗口小部件扩展程序。

如果用户已经在他的主屏幕上添加了小部件,并且当用户使用不包含窗口小部件扩展名的最新代码更新他/她的应用程序时,用户仍然可以查看空白小部件。

是否有任何方法可以从主应用程序中编程清除/删除小部件。

In last version of iOS app we have implemented widget feature, but in the coming release we have decided to remove the widget extension.

If the user has already added widget to his Home Screen and when ever user updates his/her application with latest code that does not contain widget extension, still user is able to view blank widget.

Is there any way to clear/remove widgets programatically from main app.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

情未る 2025-02-09 03:10:13

如果将WidgetConfiguration上的支持的Families修饰符设置为[],则窗口小部件将不再在窗口小部件库中显示。这可能是一种选择。

public var body: some WidgetConfiguration {
    StaticConfiguration(
      kind: kind,
      provider: Provider()
    ) { entry in
      widget_mainEntryView(entry: entry)
    }
    .configurationDisplayName("Foo")
    .description("Foo")
    .supportedFamilies([])
  }

If you set the supportedFamilies modifier on the WidgetConfiguration to [] then the widget no longer shows in the widget gallery. That might be an option.

public var body: some WidgetConfiguration {
    StaticConfiguration(
      kind: kind,
      provider: Provider()
    ) { entry in
      widget_mainEntryView(entry: entry)
    }
    .configurationDisplayName("Foo")
    .description("Foo")
    .supportedFamilies([])
  }
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文