Go to file
Sindre Sorhus 53a0ade4e9 Minor tweaks 2018-03-02 17:54:09 +07:00
DockProgress.xcodeproj Minor tweaks 2018-03-02 17:54:09 +07:00
Sources/DockProgress Minor tweaks 2018-03-02 17:54:09 +07:00
Tests/DockProgressTests Init 2018-03-02 03:18:32 +07:00
.editorconfig Init 2018-03-02 03:18:32 +07:00
.gitattributes Init 2018-03-02 03:18:32 +07:00
.gitignore Init 2018-03-02 03:18:32 +07:00
Package.swift Minor tweaks 2018-03-02 17:54:09 +07:00
license Init 2018-03-02 03:18:32 +07:00
readme.md Minor tweaks 2018-03-02 17:54:09 +07:00
screenshot-bar.gif Init 2018-03-02 03:18:32 +07:00
screenshot-circle.gif Init 2018-03-02 03:18:32 +07:00
screenshot.gif Init 2018-03-02 03:18:32 +07:00

readme.md

DockProgress

Show progress in your app's Dock icon

This package is used in production by the Gifski app. You might also like some of my other apps.

Requirements

  • macOS 10.12+
  • Xcode 9+
  • Swift 4+

Install

With SPM:

.package(url: "https://github.com/sindresorhus/DockProgress", from: "1.0.0")

With Carthage:

github "sindresorhus/DockProgress"

Usage

Manually set the progress

import Cocoa
import DockProgress

foo.onUpdate = { progress in
	DockProgress.progressValue = progress
}

Specify a Progress instance

import Cocoa
import DockProgress

let progress = Progress(totalUnitCount: 1)
progress?.becomeCurrent(withPendingUnitCount: 1)

DockProgress.progress = progress

Styles

It comes with two styles. PR welcome for more.

You can also draw a custom progress with .custom(drawHandler: (_ rect: CGRect) -> Void).

Bar

import DockProgress

DockProgress.style = .bar

This is the default.

Circle

import DockProgress

DockProgress.style = .circle(radius: 55, color: .systemBlue)

Make sure to set a radius that matches your app icon.

  • LaunchAtLogin - Add "Launch at Login" functionality to your macOS app

License

MIT © Sindre Sorhus