I always create a spinner with NSProgressIndicator
like this
let spinner = NSProgressIndicator()
spinner.style = .spinning
It works fine, but I recently found the NSProgressIndicator.Style.spinning is deprecated. I have went searched around, but did not quite find out what is the recommended way right now to create a spinner on macOS. Can anyone please help here?
Thank you
It looks like an error in the documentation. In macOS 10.15 NSProgressIndicatorBarStyle
and NSProgressIndicatorSpinningStyle
are deprecated. Somehow NSProgressIndicatorStyleBar
and NSProgressIndicatorStyleSpinning
, .bar
and .spinning
in Swift, were also deprecated in the documentation but they aren't in NSProgressIndicator.h.
typedef NS_ENUM(NSUInteger, NSProgressIndicatorStyle) {
NSProgressIndicatorStyleBar = 0,
NSProgressIndicatorStyleSpinning = 1
};
and
/* Please instead use the more modern versions of these constants.
*/
static const NSProgressIndicatorStyle NSProgressIndicatorBarStyle API_DEPRECATED_WITH_REPLACEMENT("NSProgressIndicatorStyleBar", macos(10.2,10.14)) = NSProgressIndicatorStyleBar;
static const NSProgressIndicatorStyle NSProgressIndicatorSpinningStyle API_DEPRECATED_WITH_REPLACEMENT("NSProgressIndicatorStyleSpinning", macos(10.2,10.14)) = NSProgressIndicatorStyleSpinning;