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函数获取当前编辑的widget displaySize信息

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)