Creates a Home screen quick action icon from the picture for a contact if available, or else creates a monogram from the contact name.
- iOS 9.0+
CNContactcontact object to derive the icon from.
To use this method, pass in a contact from the user’s contacts database, available through the
CNContact object. If the contact you specify has a picture, the system creates a full-color quick action icon from that picture. If the contact has no picture, the system employs the contact’s initials and displays instead a monogram.
You can, alternatively, pass in a
CNContact object you create at runtime. Such a contact must have at least a first name or a last name. The quick action icon returned from this method is then a monogram built from the contact's name. With this approach, it is not possible for you to provide an image for the quick action icon.
Finally, you can call this method with an empty contact that you create by using the
CNContact class’s inherited
init methods. With this approach, the resulting icon is a monochrome silhouette.
When providing a set of contact quick actions, ensure that every one of them has an icon. This ensures the best appearance for the set of quick actions.