Create AppAsset shared class, which will replace the separate Mac and iOS AppAssets classes.

This commit is contained in:
Brent Simmons
2024-07-08 10:07:26 -07:00
parent 89a967106d
commit ba44b94220
21 changed files with 152 additions and 143 deletions

View File

@@ -20,6 +20,22 @@ public typealias RSImage = UIImage
public extension RSImage {
static func appImage(_ name: String) -> RSImage {
RSImage(named: name)!
}
static func systemImage(_ symbolName: String) -> RSImage {
#if canImport(AppKit)
NSImage(systemSymbolName: symbolName, accessibilityDescription: nil)!
#else
UIImage(systemName: symbolName)!
#endif
}
/// Create a colored image from the source image using a specified color.
///
/// - Parameter color: The color with which to fill the mask image.