Show progress in your app's Dock icon
Switch branches/tags
Nothing to show
Clone or download
Latest commit cd0daef Oct 18, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
DockProgress.xcodeproj Upgrade to Swift 4.2 Oct 17, 2018
Example Upgrade to Swift 4.2 Oct 17, 2018
Sources/DockProgress Upgrade to Swift 4.2 Oct 17, 2018
.editorconfig Init Mar 1, 2018
.gitattributes Fix Package.swift file Jun 29, 2018
.gitignore Init Mar 1, 2018
DockProgress.podspec Upgrade to Swift 4.2 Oct 17, 2018
Package.swift Upgrade to Swift 4.2 Oct 17, 2018
license Init Mar 1, 2018
readme.md SPM → SwiftPM Oct 18, 2018
screenshot-bar.gif Init Mar 1, 2018
screenshot-circle.gif Init Mar 1, 2018
screenshot.gif Init Mar 1, 2018

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 10+
  • Swift 4.2+

Install

SwiftPM

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

Carthage

github "sindresorhus/DockProgress"

CocoaPods

pod '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.

Check out the example app in the Xcode project.

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.

Related

License

MIT © Sindre Sorhus