如何在WidgetKit的Intent Configuration中创建Toggle

问题描述

小部件中的这种Intent配置是什么?

enter image description here

选择事件可以显示或隐藏UISwitch的所属状态。我知道这是父母的财产。但是,我找不到使用UISwitch的类型意图。我需要谢谢。

解决方法

您需要将父参数的Type设置为Boolean

enter image description here

然后为event参数设置正确的关系:

enter image description here