0

How can I add a 3D Touch Colored Quick Action image like the Most Recent Action in Photos app?

http://imgur.com/VrsOtr1

My code doesn't seem to work

UIApplicationShortcutIcon *mostRecentIcon = [UIApplicationShortcutIcon iconWithTemplateImageName:@"imagename.png"];

Can you help me to solve this?

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Nick Lasta
  • 121
  • 1
  • 8

1 Answers1

0

Have you correctly specified the template image name? If the specified image name does not correctly respond to a valid image resource in the app bundle/asset catalogs, nothing would be shown in the icon image for the quick action shortcut item.

Read the Discussion section in the link below to understand the usage of iconWithTemplateImageName: https://developer.apple.com/reference/uikit/uiapplicationshortcuticon/1623367-iconwithtemplateimagename?language=objc

Also take a look at this link to see how to manage the image asset catalogs. http://help.apple.com/xcode/mac/current/#/dev10510b1f7

grane2212
  • 764
  • 1
  • 10
  • 29