Swift: How to use SF Symbols
When designing a TabView you have the option to add an icon for each tab using a system image, using the systemImage
parameter to Label
:
TabView {
Text("First")
.tabItem {
Label("First", systemImage: "tray")
}
}
In this case we use tray
.
How do you find out which other icons you can use?
Apple created an app for this, called SF Symbols. Download it from https://developer.apple.com/design/downloads/SF-Symbols.dmg, install it on your Mac and once you open it, you can browse over 1500 symbols and see their name:
→ Get my Swift Handbook
→ I wrote 17 books to help you become a better developer:
- C Handbook
- Command Line Handbook
- CSS Handbook
- Express Handbook
- Git Cheat Sheet
- Go Handbook
- HTML Handbook
- JS Handbook
- Laravel Handbook
- Next.js Handbook
- Node.js Handbook
- PHP Handbook
- Python Handbook
- React Handbook
- SQL Handbook
- Svelte Handbook
- Swift Handbook
Also, JOIN MY CODING BOOTCAMP, an amazing cohort course that will be a huge step up in your coding career - covering React, Next.js - next edition February 2025