Skip to content

Latest commit

 

History

History
17 lines (11 loc) · 487 Bytes

set-badge-icon-in-the-dock.md

File metadata and controls

17 lines (11 loc) · 487 Bytes

Set Badge Icon In The Dock

Category: Swift

Set the badge icon for applications running in the dock on macOS in Swift code as follows:

NSApp.dockTile.badgeLabel = "7";

Clear the badge icon by setting the value to an empty string.

NSApp.dockTile.badgeLabel = "";

Do not set the value in the string to a non-numeric value. Apple Human User Interface guidelines also suggest using badging to supplement notifications, not to denote critical information.