0

I have worked on extensions and it's all very interesting. For all type of extensions, icons work really well except for Action Extension where the icon is all white? Do you know how to create an icon for Action Extension?

Matthieu Rouif
  • 2,843
  • 1
  • 19
  • 28

2 Answers2

2

In the Build Phases of your Extension Settings, just add Images.xcassets (or the icon file) to the Copy Bundle Resources.

PS: For Action Icon, any color data in the image itself is ignored. via Apple Docs

The alpha channel of the image is used as a mask to generate the final image that is presented to the user. Any color data in the image itself is ignored.

c0ming
  • 3,407
  • 1
  • 21
  • 26
  • What does that mean though? My app's icon is completely opaque, does that mean I'll have a white square? Aren't most app icons completely opaque? Can I create a different image to use as the alpha channel mask? and if so, how do I tell the extension which icon to use? – Austin Fitzpatrick Sep 08 '14 at 22:02
  • The link to the Apple Docs was removed :-/ – powtac Sep 18 '14 at 15:26
0

I had to manually add my icon assets catalog in the build settings. I described it here:

To get this to work with my existing Asset Catalog, I had to add the following to the extension's Build Settings:

enter image description here

The name of the set in my Assets Catalog is "ExtIcon". I had tried setting the CFBundleIcon and the NSExtensionServiceToolbarIconFile keys in the info.plist for the extension, but had no luck. This actually seems to make sense since it is the same way that icon sets are linked to the container app, not via info.plist, but via the Build Settings.

Community
  • 1
  • 1
mahboudz
  • 39,196
  • 16
  • 97
  • 124