DisplayRepresentation.Image and custom SF Symbol

Hi,

I have a AppEnum and I try to use a custom SF Symbol as DisplayRepresentation.Image but it's not working. I get a blank image when AppEnum picker appears.

The custom SF Symbol is stored in the target's asset catalog and it works in the target (eg: Image(named: "custom_sfsymbol"). The issue occurs when I try to use it in a DisplayRepresentation

static var caseDisplayRepresentations: [Self: DisplayRepresentation] = [
		.sample : DisplayRepresentation(title: "sample_title", image: DisplayRepresentation.Image(named: "custom_sfsymbol")),

Can we use a custom SF Symbol in a DisplayRepresentation.Image?

That seems worthy of a bug report. Can you take a moment to file a report, and include a small test project with your asset configuration and the code snippet you shared here? Once you open the bug report, please post the FB number here for my reference.

If you have any questions about filing a bug report, take a look at Bug Reporting: How and Why?

As an alternative approach, you can either extract the image out to a standard image in your asset catalog (rather than a customized symbol asset in the asset catalog), or using the systemName: family of initializers on DisplayRepresentation.Image to get the symbol from the system, though you will lose the customizations by doing so.

— Ed Ford,  DTS Engineer

DisplayRepresentation.Image and custom SF Symbol
 
 
Q