5

I set system images for UIButtons and also in the tab bar. This works for iOS 14, but on iOS 13 the images are missing.

What could be the reason, for the system images to be missing on iOS 13?

Details:

I have a button with the image property set to "square.and.arrow.up" in the storyboard. (See screenshot below) The image appears on iOS 14, but not on iOS 13 (see screenshot below. Simulators overlapping)

Similar behaviour occurs for the tab bar items. (see other screenshot below)

Xcode is 12.5, MacOS 11.2.3, iOS Simulators 13.6 and 14.5. This happens on the devices too, not only in simulators.

The SF Symbols App claims that the icon is available since iOS 13+.

Any help is appreciated :-)

UIButton image property in storyboard

Appearance in two simulators

Appearance for tab bar items in simulators

Icon availability

Mojtaba Hosseini
  • 95,414
  • 31
  • 268
  • 278
Rainer Schwarze
  • 4,725
  • 1
  • 27
  • 49

1 Answers1

8

It seems like a bug .

✅ Use this bug as a feature!

Although it is a bug, it's a very good practice to always have a fallback for these kinds of ongoing stuff.

So try to export the symbol (File -> Export..) and import it as an asset to the assets catalog.

Note that although Xcode supports imported symbols, you may consider using a separated icon file (like a PDF) for older iOS devices.


Besides it is more reliable, it will bring some other benefits to your project:

1. Backward compatibility

Since it uses the embedded assets in the bundle, they can be used even in iOS 12 and below.

2. Forward compatibility!

All versions of SF Symbols.app have come out as a beta app and Apple is constantly changing the conventions and rules and other aspects of creating and using these symbols.

For example, take a look at this naming convention: Demo1

As you can see, The name of this symbol is changed from iOS 15, and old codes will not show this in the future!

3. Wider support

You can use these exported symbols where there is no direct support for using symbols (like UIApplicationShortcutItem when it wasn't supported in the early versions and here is the full example)

Wrap it up:

So it is a good choice to always have backups of symbols and fall back to them if something went wrong...

Mojtaba Hosseini
  • 95,414
  • 31
  • 268
  • 278
  • Thanks for the answer. And sorry for being late for awarding the bounty. I was just making the adjustments in my project to check them and saw the message pop up, that the bounty is auto awarded. If you happen to know, whether I can still award the full bounty, please let me know; however, it doesn't look like this is possible. – Rainer Schwarze Jun 13 '21 at 18:06
  • No, you can't but it doesn't matter :) . I hope the answer is right to your question and helped you. – Mojtaba Hosseini Jun 13 '21 at 18:09
  • I just noted, that when I import the svg file, add it to an asset and use it in the tab bar item, the symbol is rendered smaller than when using the same system image. Do you know, whether the symbol size can be adjusted in IB? I looked at a few settings, which I thought could have an influence, but none of them actually do. – Rainer Schwarze Jun 13 '21 at 18:14