- Notifications
You must be signed in to change notification settings - Fork7
CodeEditApp/CodeEditSymbols
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
A package containing all custom assets for CodeEdit. These are mostly customSF Symbols.
import CodeEditSymbolsletnsImage=NSImage.symbol(named:"name_of_the_symbol")// or using the static property:letnsImage1=NSImage.name_of_the_symbol
import CodeEditSymbolsletimage=Image(symbol:"name_of_the_symbol")// or using the static property:letimage1=Image.name_of_the_symbol
To create a new asset, follow the guide onApple's developer website.
Add the.svg you exported fromSF Symbols.app to theSymbols.xcassets catalog.
Also add a static property to theImage andNSImage extension like so:
// Image Extensionstaticletyour_symbol_name:Image=.init(symbol:"your_symbol_name")// NSImage Extensionstaticletyour_symbol_name:NSImage=.symbol(named:"your_symbol_name")
Important: Make sure your symbol looks great in every font weight.
Also include snapshot tests for each symbol forImage as well asNSImage:
// MARK: YOUR_SYMBOL_NAMEfunc testCreateNSImageYourSymbolName(){letimage=NSImage.your_symbol_nameletview=NSImageView(image: image) view.appearance=.init(named:.aqua)assertSnapshot(matching: view, as:.image, record: record)}
// MARK: YOUR_SYMBOL_NAMEfunc testCreateImageYourSymbolName(){letimage=Image.your_symbol_nameletview:NSView=NSHostingController(rootView: image).view view.appearance=.init(named:.aqua)assertSnapshot(matching: view, as:.image(size: view.intrinsicContentSize))}
Keep different variants of a symbol in the same parent folder and name them appropriately (see Apple's own symbols for reference).
You might have a symbol calledlock and one where the symbol is inside a square where you would call that filelock.square. Also keep in mind to also provide a.fill variant if appropriate (lock.fill,lock.square.fill)
As of version 3 ofSF Symbols it is possible to createmulti-color,hierarchical andpalette annotations inside theSF Symbols.app. Be sure to annotate it accordingly if appropriate.
About
Resources
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors3
Uh oh!
There was an error while loading.Please reload this page.

