swiftui - Swiftui 如何在 IntentHandling 中获取小部件 displaySize 信息
问题描述
我实现了动态配置信息,代码如下。
import Intents
import WidgetKit
class IntentHandler: INExtension, ConfigurationIntentHandling {
func resolveTransparent(for intent: ConfigurationIntent, with completion: @escaping (INStringResolutionResult) -> Void) {
}
func provideTransparentOptionsCollection(for intent: ConfigurationIntent, searchTerm: String?, with completion: @escaping (INObjectCollection<NSString>?, Error?) -> Void) {
//how to get widget displaySize?
}
func handle(intent: ConfigurationIntent, completion: @escaping (ConfigurationIntentResponse) -> Void){
// This is the default implementation. If you want different objects to handle different intents,
// you can override this and return the handler you want for that particular intent.
}
}
如何在 a 函数中获取当前编辑的小部件 displaySize 信息
解决方案
推荐阅读
- jquery - jQuery Alert + fancybox 堆叠问题
- python-3.x - 使用@rpath/libpoppler.71.dylib 找不到图像
- javascript - 获取文本(dom 元素)并将其放置在单独的跨度中,然后使其按字母顺序显示在页面上
- selenium - 我正在将 Selenium 与 java 一起使用,我想做 CI 的设置 ustin Gitlab CI
- ios - 将天气数据传输到容器视图
- docker - 如何从文件中加载我的 Jenkins 管道 (Jenkinsfile) 的 Docker 部分?
- angular - 角度验证器检查数组
- java - 使用java将pdf表格数据转换为excel
- apache-spark - 如何从 SparkSession 获取作业或应用程序 ID?
- c#-4.0 - 如何从 SharePoint.Client.ListItemCollection C# 中删除行