Skip to content

Latest commit

 

History

History
56 lines (48 loc) · 1.93 KB

3d-touch.md

File metadata and controls

56 lines (48 loc) · 1.93 KB

3D Touch

  • Home Screen Quick Actions (主屏快捷行为入口)
  • peek and pop (预览和弹出)
  • Force Properties (按压力度)
  • Web view peek and pop API (HTML链接预览功能)

Home Screen Quick Actions

Info.plist 添加

<key>UIApplicationShortcutItems</key>
<array>
  <dict>
    <key>UIApplicationShortcutItemIconType</key>
    <string>UIApplicationShortcutIconTypeSearch</string>
    <key>UIApplicationShortcutItemSubtitle</key>
    <string>shortcutSubtitle1</string>
    <key>UIApplicationShortcutItemTitle</key>
    <string>shortcutTitle1</string>
    <key>UIApplicationShortcutItemType</key>
    <string>$(PRODUCT_BUNDLE_IDENTIFIER).First</string>
    <key>UIApplicationShortcutItemUserInfo</key>
    <dict>
      <key>firstShorcutKey1</key>
      <string>firstShortcutKeyValue1</string>
    </dict>
  </dict>
  <dict>
    <key>UIApplicationShortcutItemIconType</key>
    <string>UIApplicationShortcutIconTypeShare</string>
    <key>UIApplicationShortcutItemSubtitle</key>
    <string>shortcutSubtitle2</string>
    <key>UIApplicationShortcutItemTitle</key>
    <string>shortcutTitle2</string>
    <key>UIApplicationShortcutItemType</key>
    <string>$(PRODUCT_BUNDLE_IDENTIFIER).Second</string>
    <key>UIApplicationShortcutItemUserInfo</key>
    <dict>
      <key>secondShortcutKey1</key>
      <string>secondShortcutValue1</string>
    </dict>
  </dict>
</array>

iOS 模拟器支持 3D Touch

参考 https://stackoverflow.com/a/32533162,模拟器设置里没有 3D Touch 的设置,但是如果 Mac 支持 3D Touch,就可以直接用 Mac 的 3D Touch

References