How to use SF Symbols in iOS 12 and below?

2020-02-26 03:01发布

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 if it is possible to use them in lower versions of iOS too.

If I want to use them, do I have to implement a fallback for older versions?

7条回答
老娘就宠你
2楼-- · 2020-02-26 03:37

This icon set is based on SF Symbols https://framework7.io/icons/

查看更多
Summer. ? 凉城
3楼-- · 2020-02-26 03:40

I made a tools can export sfsymbols to Xcode easily:

icon picker

https://happycoding.app

查看更多
闹够了就滚
4楼-- · 2020-02-26 03:43

SF Symbols is a system only supported on iOS 13 or later - it's not possible to use them on iOS 12 or below. You'll need to use fallbacks for those older operating systems.

See Human Interface Guidelines

查看更多
Ridiculous、
5楼-- · 2020-02-26 03:44

You can open .svg use Figma. Then select the Regular-M and export as PDF or PNG.

查看更多
老娘就宠你
6楼-- · 2020-02-26 03:48

Work around in progress

I did not manage to find the solution, I gave up, but actually I went pretty far in investigating. Maybe someone luckier than me will be able to figure out hpw to continue the work I started:

In Apple documentation, it is said that, in order to easily browse all the new iOS 13 SF Symbols, you can dowmload the SF Symbols app : https://developer.apple.com/design/human-interface-guidelines/sf-symbols/overview/

Once instaled you can go in Application > SF Symbols > showPackage content

enter image description here

From there, under content > Resources we can find an interesting file named SFSymbolsFallback.ttf

enter image description here

And if you try to open this file on https://fontdrop.info/ you can see that it contains all the font glyphs that are released in iOS 13 as SF Font, with associated unicodes

enter image description here


Bingo? not so fast...

From there I tried to import this .ttf into my project in iOS 12, on XCode 10.2.1, but it seems that it is never properly imported. It is not retrievable in the list of available fonts when calling UIFont.familyNames

More interesting, if I try to import this font in Font Book app, I receive a warning that says that it contains duplication, some kind of conflict with an existing font

enter image description here


From there?

My guess is that there is another font that prevent SF Symbols to be installed, in Font Book and on Xcode.

One of the solution could be to find the one that is in conflict in XCode package and delete it ( this may be Symbols font or San Francisco that are causing problems idk)

I also tried to open the font file with a font editor and change its Name and family Name without success.

If anyone want to continue investigating..

Hope this can help someone !

查看更多
smile是对你的礼貌
7楼-- · 2020-02-26 03:50

You can not use SFSymbols natively in iOS versions older than iOS 13.

However if you are interested in using the graphics you can use the SFSymbols app to export SVG versions of the icon. Then use some graphics tool to convert them to icons you can import into your asset catalog.

Screenshot how to export SVG from SFSymbols app on Mac.

According to the Human Interface Guidelines you should not use the new icons in older iOS releases though:

You can use SF Symbols in apps running in iOS 13 and later, watchOS 6 and later, and tvOS 13 and later. To browse the full set of symbols, download the SF Symbols app. https://developer.apple.com/design/human-interface-guidelines/sf-symbols/overview/

查看更多
登录 后发表回答