Creates a Home screen quick action icon based on an image in your app’s bundle, preferably in an asset catalog.


convenience init(templateImageName: String)



The name of a custom image in the app’s asset catalog. If the image is not in your app’s asset catalog, this method searches the app bundle for the image.

You do not need to specify the filename extension or the @2x or @3x modifiers for this name. This method retrieves the appropriate image based on the system and the available image resources.

Return Value

A Home screen quick action icon initialized with the specified template image provided by your app.


Use this method to create icons based on custom artwork that you provide. If the image name you specify does not correspond to a valid image resource in your app bundle, no icon is displayed for the quick action that you associate the icon with.

Icons should be square, single color, and 35x35 points, as shown in these template files and as described in Template Images in UIKit User Interface Catalog and in iOS Human Interface Guidelines.

See Also

Creating a Quick Action Icon

init(type: UIApplicationShortcutIcon.IconType)

Creates a Home screen quick action icon using a system-defined image.

init(systemImageName: String)

Creates a Home screen quick action icon using a system symbol image.

init(contact: CNContact)

Creates a Home screen quick action icon from the picture for a contact or a monogram of the contact name if the picture unavailable.