xgqfrms™, xgqfrms® : xgqfrms's offical website of cnblogs! xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!

Apple SF Symbols All In One

SF Symbols All In One

SF Symbols 3

SF Symbols is a library of iconography designed to integrate seamlessly with San Francisco, the system font for Apple platforms.

SF Symbols 是一个图标库,旨在与 Apple 平台的系统字体 San Francisco 无缝集成。

https://developer.apple.com/sf-symbols/

SwiftUI SF Symbols cheat sheet

https://sfsymbols.com/

SwiftUI SF Symbols 在线搜索

https://hotpot.ai/free-icons?s=sfSymbols

release

在线搜索 icon 名称

https://developer.apple.com/sf-symbols/release-notes/

demo



struct MyContentView: View {
  @State var emojiCount = 6;
  let emojis = ["😃", "😃", "🐻", "🍔", "⚽","🦍","🦊","🦌","🦏","🦇","🦅","🦆","🦉","🦐","🦑","🦋","🥀","🦓","🦒","🦔","🦕","🦖","🦗","🐉","🐲","🌵","🌳","🌴","🌱","🌿","☘","🍀","🎍","🎋","🍃","🍂","🍁","🌾","🌺","🌻","🌹","🌷","🌼","🌸","💐","🍄","🌰","🎃","🐚"];
  var body: some View {
    VStack {
      HStack {
        // struct ForEach<Data, ID, Content> where Data : RandomAccessCollection, ID : Hashable
        // 动态数组范围,使用 id 防止 emoji 重复导致报错
        ForEach (emojis[0..<emojiCount], id: \.self) { emoji in
          CardView(content: emoji);
        }
      }
      Spacer()
      HStack {
        // 按钮
        Button (
          action: {
            if(emojiCount > 1) {
              emojiCount -= 1;
            }
            print("remove \(emojiCount)");
          }, label: {
            // 系统字体 icon
            Image(systemName: "minus.circle");
          }
        )
        Spacer()
        Button (
          action: {
            if(emojiCount < emojis.count) {
              emojiCount += 1;
            }
            print("add \(emojiCount)");
          }, label: {
            // 系统字体 icon
            Image(systemName: "plus.circle");
          }
        )
      }.font(.largeTitle)
    }
    .padding(.horizontal)
    .foregroundColor(.red)
  };
}


refs

https://devimages-cdn.apple.com/design/resources/download/SF-Symbols-3.2.dmg

https://devimages-cdn.apple.com/design/resources/download/SF-Symbols-2.1.dmg



©xgqfrms 2012-2020

www.cnblogs.com/xgqfrms 发布文章使用:只允许注册用户才可以访问!

原创文章,版权所有©️xgqfrms, 禁止转载 🈲️,侵权必究⚠️!


posted @ 2022-03-29 00:38  xgqfrms  阅读(190)  评论(4编辑  收藏  举报