Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
NotificationsYou must be signed in to change notification settings

CodeEditApp/CodeEditSymbols

Repository files navigation

A package containing all custom assets for CodeEdit. These are mostly customSF Symbols.

How to use

NSImage:

import CodeEditSymbolsletnsImage=NSImage.symbol(named:"name_of_the_symbol")// or using the static property:letnsImage1=NSImage.name_of_the_symbol

Image:

import CodeEditSymbolsletimage=Image(symbol:"name_of_the_symbol")// or using the static property:letimage1=Image.name_of_the_symbol

Creating a new Asset

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.

Tests

Also include snapshot tests for each symbol forImage as well asNSImage:

NSImage:

// 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)}

Image:

// 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))}

Variants

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)

Example of a.fill Variant

Screen Shot 2022-04-18 at 00 29 57

Annotate the Symbol

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.

Screen Shot 2022-04-18 at 00 40 26

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors3

  •  
  •  
  •  

Languages


[8]ページ先頭

©2009-2025 Movatter.jp