Store the `Progress` instance weakly
This commit is contained in:
parent
cbc3e53a03
commit
3365c2be40
|
@ -9,7 +9,7 @@ public final class DockProgress {
|
||||||
NSApp.dockTile.contentView = $0
|
NSApp.dockTile.contentView = $0
|
||||||
}
|
}
|
||||||
|
|
||||||
public static var progressInstance: Progress? {
|
public static weak var progressInstance: Progress? {
|
||||||
didSet {
|
didSet {
|
||||||
guard let progressInstance = progressInstance else {
|
guard let progressInstance = progressInstance else {
|
||||||
return
|
return
|
||||||
|
|
|
@ -57,6 +57,8 @@ progress?.becomeCurrent(withPendingUnitCount: 1)
|
||||||
DockProgress.progressInstance = progress
|
DockProgress.progressInstance = progress
|
||||||
```
|
```
|
||||||
|
|
||||||
|
The given `Progress` instance is weakly stored. It's up to you to retain it.
|
||||||
|
|
||||||
## Styles
|
## Styles
|
||||||
|
|
||||||
It comes with three styles. PR welcome for more.
|
It comes with three styles. PR welcome for more.
|
||||||
|
|
Loading…
Reference in New Issue