When in storyboard view, click the add button at the top of the screen. If you click the image icon in the dialog that opens, you can scroll through all system icons. You can then use them by referncing the icon name in UIImage(systemName: iconName) . Tested in Xcode 12.5.
SwiftUI uses the systemName parameter for SF Symbol lookup. Keep in mind that you can use string interpolation to show an SF Symbol as the part of any text. Another SwiftUI view that plays well with SF Symbols is Label. The Label view contains both text and an image and shows them according to the current context.
Drag and drop image onto Xcode's assets catalog. Or, click on a plus button at the very bottom of the Assets navigator view and then select “New Image Set”. After that, drag and drop an image into the newly create Image Set, placing it at appropriate 1x, 2x or 3x slot.
These icons are called SF Symbols. There are over 2,400 symbols you can use in iOS 13 and later, macOS 11 and later, watchOS 6 and later, and tvOS 13 and later. You can use a symbol everywhere you can use an image.
To browse the full set of symbols, download the SF Symbols app. For more info about SF Symbols check here.
SF Symbols 2 introduces over 750 new symbols and includes:
Usage
UIKit:
let heartImage = UIImage(systemName: "heart.fill")
SwiftUI:
let heartImage = Image(systemName: "heart.fill")
Apple has a dedicated App for this called SF Symbol. You should download the latest version from here to browse the full set of symbols.
You should always stay with the app to have new symbols available for preview, export and enjoy.
If you need to use new symbols like the new multi-color ones that introduced in SF Symbols 2.0 for iOS 14 and above, you can export them using the app itself and import them as assets in the project. Step 1 and 2 of this answer shows how you can export symbols to use it for older iOS versions
You can use SF Symbol Images in SwiftUI
Image(systemName: "person")
Download Link : https://developer.apple.com/design/resources/
Assuming you have Xcode installed, you can also preview all the images without needing to download a separate app.
The trick is you need to view them in a Storyboard, not a SwiftUI Canvas.
Add a UIImageView to your storyboard, then press the dropdown arrow near Image. You'll see the entire list of images provided by Apple:
Copy the name of an image, and then use it just like other answers mention above:
Image(systemName: "square.and.arrow.up")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With