This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension NSProgressIndicator { | |
func set(tintColor: NSColor) { | |
guard let adjustedTintColor = tintColor.usingColorSpace(.deviceRGB) else { | |
contentFilters = [] | |
return | |
} | |
let tintColorRedComponent = adjustedTintColor.redComponent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
extension Date { | |
func toString(format: String = "yyyy-MM-dd") -> String { | |
let formatter = DateFormatter() | |
formatter.dateStyle = .short | |
formatter.dateFormat = format | |
return formatter.string(from: self) | |
} |