Overview
This week, we’ll be learning how inject imagery into your app creations. Between pics and SF symbols (images that act like fonts), you’ll learn how to find, insert, and modify imagery to create a visual work of art, or at least a great looking UI! You are going to enjoy chapter 3 from Mastering SwiftUI, so go ahead and give it a read!
Read Chapter 3: Working with Images in Mastering SwiftUI
Key Takeaways
- Images are displayed using the
Imageview — pass a filename string for asset images, or a symbol name usingImage(systemName:)for SF Symbols. - SF Symbols are Apple’s library of 5,000+ scalable icons that behave like fonts — they automatically scale with Dynamic Type and adopt your app’s tint color.
.resizable()must be applied before you can change an image’s size with.frame()— without it, the frame modifier has no effect..scaledToFit()preserves aspect ratio while fitting within the frame;.scaledToFill()fills the frame and may crop.