From 50bdc0a83c57e1172b2fcf69267e38bf3565863e Mon Sep 17 00:00:00 2001 From: Henrik Panhans Date: Wed, 16 Dec 2020 00:18:50 +0100 Subject: [PATCH] trying to fix cocoapods error --- .../HPOpenWeather/DataTypes/WeatherIcon.swift | 35 +++++++------------ 1 file changed, 12 insertions(+), 23 deletions(-) diff --git a/Sources/HPOpenWeather/DataTypes/WeatherIcon.swift b/Sources/HPOpenWeather/DataTypes/WeatherIcon.swift index 7a64479..c327a75 100644 --- a/Sources/HPOpenWeather/DataTypes/WeatherIcon.swift +++ b/Sources/HPOpenWeather/DataTypes/WeatherIcon.swift @@ -31,24 +31,32 @@ public enum WeatherIcon: String, Codable, CaseIterable { @available(iOS 13.0, macOS 11.0, tvOS 13.0, watchOS 6.0, *) public extension WeatherIcon { + var systemImageName: String { + makeIconName(filled: false) + } + + var systemImageNameFilled: String { + makeIconName(filled: true) + } + #if canImport(UIKit) func filledUIImage(withConfiguration configuration: UIImage.Configuration? = nil) -> UIImage? { - UIImage(systemName: makeIconName(filled: true), withConfiguration: configuration) + UIImage(systemName: systemImageNameFilled, withConfiguration: configuration) } func outlineUIImage(withConfiguration configuration: UIImage.Configuration? = nil) -> UIImage? { - UIImage(systemName: makeIconName(filled: false), withConfiguration: configuration) + UIImage(systemName: systemImageName, withConfiguration: configuration) } #elseif canImport(AppKit) func filledNSImage(accessibilityDescription: String? = nil) -> NSImage? { - NSImage(systemSymbolName: makeIconName(filled: true), accessibilityDescription: accessibilityDescription) + NSImage(systemSymbolName: systemImageNameFilled, accessibilityDescription: accessibilityDescription) } func outlineNSImage(accessibilityDescription: String? = nil) -> NSImage? { - NSImage(systemSymbolName: makeIconName(filled: false), accessibilityDescription: accessibilityDescription) + NSImage(systemSymbolName: systemImageName, accessibilityDescription: accessibilityDescription) } #endif @@ -86,22 +94,3 @@ public extension WeatherIcon { } } - -#if canImport(SwiftUI) - -import SwiftUI - -@available(iOS 13.0, macOS 11.0, tvOS 13.0, watchOS 6.0, *) -public extension WeatherIcon { - - func filledImage() -> SwiftUI.Image { - SwiftUI.Image(systemName: makeIconName(filled: true)) - } - - func outlineImage() -> SwiftUI.Image { - SwiftUI.Image(systemName: makeIconName(filled: false)) - } - -} - -#endif