Use SF Symbols system image for static UIApplicationShortcutItem

后端 未结 3 828
灰色年华
灰色年华 2021-02-19 01:24

When specifying home screen quick actions, UIApplicationShortcutItems, in your Info.plist, is there a way to use a system image from SF Symbols?

The docs no

3条回答
  •  失恋的感觉
    2021-02-19 02:19

    Seems like there is no way to directly use those. But since there are not much symbols that you need to use statically at the same time, here is the solution:

    1. Select the symbol you need and export it from SF Symbols.app:

    1. Import it in the Assets.xcassets:

    1. Use it's name for the key UIApplicationShortcutItemIconFile:

    Result

    I hope Apple add direct support for SF Symbols soon.

提交回复
热议问题