Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Made NSImage.symbol optional #20

Merged
merged 2 commits into from
Mar 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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