ios10上3D touch多个widget的显示

来源:互联网 发布:服务器主流软件 编辑:程序博客网 时间:2024/05/01 08:45

ios10上3D touch多个widget的显示

在ios10前 3D touch没有widget显示,ios10后默认显示widget。
但是问题来了,要是一个app有多个widget,3D touch就不知道要用哪个了。

这就需要在工程的plist文件里面加上个UIApplicationShortcutWidget 的key,里面填你想要显示的widget的BundleIdentifier

官方文档
https://developer.apple.com/library/prerelease/content/documentation/General/Reference/InfoPlistKeyReference/Articles/iPhoneOSKeys.html#//apple_ref/doc/uid/TP40009252-SW32

这里写图片描述


系统会自动改成Home Screen Widget

如下图
这里写图片描述

1 0
原创粉丝点击