NSFileProviderItemDecorating
Support for decorating items.
Declaration
protocol NSFileProviderItemDecorating : NSFileProviderItemProtocolOverview
To adopt this protocol, implement the decorations method for your extension’s NSFileProviderItem and return valid identifiers for the desired decorations.
You define decorations in the File Provider extension’s Info.plist file by adding the NSFileProviderDecorations key to the NSExtension dictionary.
<key>NSFileProviderDecorations</key>
<array>
<dict>
<key>Identifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER).hasComments</string>
<key>BadgeImageType</key>
<string>com.someone.item.decoration.unreadCommentIcon</string>
<key>Category</key>
<string>Badge</string>
<key>LocalizedTitle</key>
<dict>
<key>NSStringFormat</key>
<string>%@ unread comments</string>
<key>NSStringFormatValues</key>
<array>
<string>item.userInfo.unreadCommentCount</string>
</array>
</dict>
</dict>
</array>Use the following keys to define the decorations:
IdentifierThe decoration’s identifier.
BadgeImageTypeA UTI for the item’s badge. To define the badge, create a new UTI that conforms to
com.apple.icon-decoration.badgeand set its icon.LabelA localizable title for the item. For example, the system displays a title in detail views and VoiceOver.
CategoryA string that defines the location of the badge image.
The Category value must be one of the following:
BadgeThe system displays the badge image on top of the item’s icon. It only displays the first
Badgeimage.SharingThe system displays the badge image below the icon. It only displays the first
Sharingimage.FolderBadgeOnly available on folder items. The system embosses the image over the folder icon. It only displays the first
FolderBadgeimage.