How to use SF Symbols in iOS 12 and below?

后端 未结 8 1843
南方客
南方客 2020-12-24 04:53

I am updating the icons in my app. After I heard Apple released an icon font named SF Symbols with iOS 13, I was wondering if I can only use them in iOS 13 or i

8条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-24 05:41

    1. Import the font:

    Open the Fonts app, search for the SF Pro Rounded font, right-click on the variant you want (e.g. Light) and click Show in Finder. Drag that file (e.g. SF-Pro-Rounded-Light.otf) into your XCode project and tick "Copy if necessary".

    2. Select the font:

    Select your UILabel or UIButton, set the Title to Attributed (this is important) and select the font you just copied (e.g. SF Pro Rounded Light).

    3. Set the symbol:

    Find the icon you want in SF Symbols, select it, press CMD+C to copy, switch back to XCode and click in the text part of the UILabel or UIButton Title and press CMD+V to paste.

    A huge thank you to Dave van Wijk for the solution!

提交回复
热议问题