Skip to content

Commit

Permalink
Made NSImage.symbol optional (#20)
Browse files Browse the repository at this point in the history
* Made NSImage.symbol optional

* Made NSImage.symbol optional
  • Loading branch information
austincondiff authored Mar 22, 2024
1 parent 8262a5d commit a794528
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions Sources/CodeEditSymbols/CodeEditSymbols.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,28 +43,28 @@ public extension NSImage {
/// Returns a NSImage representing a custom SF Symbol
/// - Parameter named: The name of the symbol in `Symbols.xcassets`
/// - Returns: a NSImage
static func symbol(named: String) -> NSImage {
Bundle.module.image(forResource: named) ?? .init()
static func symbol(named: String) -> NSImage? {
Bundle.module.image(forResource: named)
}

// MARK: - Symbols

static let vault: NSImage = .symbol(named: "vault")
static let vaultFill: NSImage = .symbol(named: "vault.fill")
static let commit: NSImage = .symbol(named: "commit")
static let checkout: NSImage = .symbol(named: "checkout")
static let branch: NSImage = .symbol(named: "branch")
static let breakpoint: NSImage = .symbol(named: "breakpoint")
static let breakpointFill: NSImage = .symbol(named: "breakpoint.fill")
static let chevronUpChevronDown: NSImage = .symbol(named: "chevron.up.chevron.down")
static let github: NSImage = .symbol(named: "github")
static let docJava: NSImage = .symbol(named: "doc.java")
static let docJavascript: NSImage = .symbol(named: "doc.javascript")
static let docJson: NSImage = .symbol(named: "doc.json")
static let docPython: NSImage = .symbol(named: "doc.python")
static let docRuby: NSImage = .symbol(named: "doc.ruby")
static let squareSplitHorizontalPlus: NSImage = .symbol(named: "square.split.horizontal.plus")
static let squareSplitVerticalPlus: NSImage = .symbol(named: "square.split.vertical.plus")
static let vault: NSImage? = .symbol(named: "vault")
static let vaultFill: NSImage? = .symbol(named: "vault.fill")
static let commit: NSImage? = .symbol(named: "commit")
static let checkout: NSImage? = .symbol(named: "checkout")
static let branch: NSImage? = .symbol(named: "branch")
static let breakpoint: NSImage? = .symbol(named: "breakpoint")
static let breakpointFill: NSImage? = .symbol(named: "breakpoint.fill")
static let chevronUpChevronDown: NSImage? = .symbol(named: "chevron.up.chevron.down")
static let github: NSImage? = .symbol(named: "github")
static let docJava: NSImage? = .symbol(named: "doc.java")
static let docJavascript: NSImage? = .symbol(named: "doc.javascript")
static let docJson: NSImage? = .symbol(named: "doc.json")
static let docPython: NSImage? = .symbol(named: "doc.python")
static let docRuby: NSImage? = .symbol(named: "doc.ruby")
static let squareSplitHorizontalPlus: NSImage? = .symbol(named: "square.split.horizontal.plus")
static let squareSplitVerticalPlus: NSImage? = .symbol(named: "square.split.vertical.plus")

// add static properties for your symbols above this line

Expand Down

0 comments on commit a794528

Please sign in to comment.