diff --git a/Sources/ColorWellKit/Utilities/ColorHelpers.swift b/Sources/ColorWellKit/Utilities/ColorHelpers.swift index 72c9ecb..478d43b 100644 --- a/Sources/ColorWellKit/Utilities/ColorHelpers.swift +++ b/Sources/ColorWellKit/Utilities/ColorHelpers.swift @@ -50,7 +50,7 @@ struct ColorInfo: CustomStringConvertible { init(color: NSColor) { switch color.colorSpace.colorSpaceModel { case _ where color.type != .componentBased: - cwk_log( + cw_log( "Attempted to get the components for a non component-based color", category: .components, type: .error diff --git a/Sources/ColorWellKit/Utilities/Logging.swift b/Sources/ColorWellKit/Utilities/Logging.swift index 8f8d4cd..b3137e3 100644 --- a/Sources/ColorWellKit/Utilities/Logging.swift +++ b/Sources/ColorWellKit/Utilities/Logging.swift @@ -37,6 +37,6 @@ extension LogCategory { } /// Sends a message to the logging system using the given category and log level. -func cwk_log(_ message: String, category: LogCategory = .main, type: OSLogType = .default) { +func cw_log(_ message: String, category: LogCategory = .main, type: OSLogType = .default) { os_log("%@", log: category.log, type: type, message) } diff --git a/Sources/ColorWellKit/Views/Cocoa/CWColorWellBaseControl.swift b/Sources/ColorWellKit/Views/Cocoa/CWColorWellBaseControl.swift index 8dca37f..31b711d 100644 --- a/Sources/ColorWellKit/Views/Cocoa/CWColorWellBaseControl.swift +++ b/Sources/ColorWellKit/Views/Cocoa/CWColorWellBaseControl.swift @@ -277,9 +277,9 @@ extension _CWColorWellBaseControl { private extension NSColorWell { @nonobjc static let swizzler: () = { let originalActivateSel = #selector(activate) - let swizzledActivateSel = #selector(cwk_swizzled_activate) + let swizzledActivateSel = #selector(cw_swizzled_activate) let originalDeactivateSel = #selector(deactivate) - let swizzledDeactivateSel = #selector(cwk_swizzled_deactivate) + let swizzledDeactivateSel = #selector(cw_swizzled_deactivate) guard let originalActivateMethod = class_getInstanceMethod(NSColorWell.self, originalActivateSel), @@ -296,7 +296,7 @@ private extension NSColorWell { // MARK: Activate - @objc private func cwk_swizzled_activate(_ exclusive: Bool) { + @objc private func cw_swizzled_activate(_ exclusive: Bool) { // important that we capture the last attached object and its color // BEFORE activating and attaching, so we know what color to take let lastAttachedObject = NSColorPanel.shared.attachedObjects.last @@ -308,7 +308,7 @@ private extension NSColorWell { // NOTE: since this method and the original have been swizzled, // a call to this method is actually a call to the original - cwk_swizzled_activate(exclusive) + cw_swizzled_activate(exclusive) // attach to match CWColorWell's behavior NSColorPanel.shared.attach(self) @@ -327,10 +327,10 @@ private extension NSColorWell { // MARK: Deactivate - @objc private func cwk_swizzled_deactivate() { + @objc private func cw_swizzled_deactivate() { // NOTE: since this method and the original have been swizzled, // a call to this method is actually a call to the original - cwk_swizzled_deactivate() + cw_swizzled_deactivate() // detach to match CWColorWell's behavior NSColorPanel.shared.detach(self) diff --git a/Sources/ColorWellKit/Views/Cocoa/CWColorWellPopover.swift b/Sources/ColorWellKit/Views/Cocoa/CWColorWellPopover.swift index 01eeedd..678d0c1 100644 --- a/Sources/ColorWellKit/Views/Cocoa/CWColorWellPopover.swift +++ b/Sources/ColorWellKit/Views/Cocoa/CWColorWellPopover.swift @@ -79,7 +79,7 @@ extension CWColorWellPopover { func setPadding() { guard layoutView.superview === self else { - cwk_log( + cw_log( "Popover layout view is missing from its expected superview.", category: .popover ) @@ -173,7 +173,7 @@ extension CWColorWellPopover { private func setRows(with colorWell: CWColorWell) { guard swatches.isEmpty else { - cwk_log("SwatchLayout rows already set", category: .popover) + cw_log("SwatchLayout rows already set", category: .popover) return }