Latest 0.2.2
Homepage https://github.com/gergelysanta/ProgressImage
License MIT
Platforms osx 10.10
Authors

Version
License
Xcode 9
Swift 4
Platform
CI Status

An enhanced NSImage displaying simple customizable progressbar. This can be used in places where standard images are used,
like in context menus or status item (item in menubar/menuextras).

ProgressImage used in StatusItem in Menu Extras (menubar):
Screenshot#1

and in macOS Mojave in dark mode:
Screenshot#2

In action:
Anim#1

ProgressImage used in NSImageView and in NSMenuItem in context menu:
Screenshot#3

also in macOS Mojave in dark mode:
Screenshot#4

Important note for building in macOS Mojave with Xcode10

Dark mode support uses API from SDK 10.14 which is available in Xcode10. As Xcode10 is only in Beta phase yet, 10.14 API calls were commented out so
ProgressImage can be built in Xcode latest release (Xcode9). If you’re building your project in Xcode10 for macOS Mojave, uncomment the following lines:

ProgressImageView.swift lines 88-94:

// !!! Uncomment for Xcode10 !!!
//  public override func viewDidChangeEffectiveAppearance() {
//      if let progress = progressImage?.progress {
//          // Re-set the same progress
//          // This will force the progress image to redraw itself
//          progressImage?.progress = progress
//      }
//  }

ProgressImage.swift lines 154-156 and 158:

// !!! Uncomment for Xcode10 !!!
//      if #available(macOS 10.14, *) {
//          isDarkModeEnabled = (NSApp.effectiveAppearance.name == .darkAqua)
//      } else {
            isDarkModeEnabled = false
//      }

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Installation

ProgressImage is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod 'ProgressImage'

Author

Gergely Sánta, gergely.[email protected]

License

ProgressImage is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "ProgressImage",
    "version": "0.2.2",
    "summary": "A small customizable ProgressImage usable in menu extras or context menus.",
    "description": "This is an NSImage enhancement displaying a small progressbar.nWhy NSImage? The main point was to create a progressbar usable in menu extras (menubar)nor in context menus and those items can contain only NSImages. ProgressImage is a smallnconfigurable image displaying graphical progress so you can visualize any progress upnin the menu extras bar for example.",
    "homepage": "https://github.com/gergelysanta/ProgressImage",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Gergely Su00e1nta": "[email protected]"
    },
    "source": {
        "git": "https://github.com/gergelysanta/ProgressImage.git",
        "tag": "0.2.2"
    },
    "social_media_url": "https://twitter.com/gergelysanta",
    "platforms": {
        "osx": "10.10"
    },
    "osx": {
        "frameworks": "Cocoa"
    },
    "swift_version": "4.0",
    "source_files": "Source/**/*"
}

Pin It on Pinterest

Share This