How do I set the size of a SF Symbol in SwiftUI?
You can set weights and sizes:
Image(systemName: "checkmark.circle")
.font(.system(size: 16, weight: .ultraLight))
Image(systemName: "checkmark.circle")
.font(.system(size: 16, weight: .thin))
Image(systemName: "checkmark.circle")
.font(.system(size: 16, weight: .light))
Image(systemName: "checkmark.circle")
.font(.system(size: 16, weight: .regular))
Image(systemName: "checkmark.circle")
.font(.system(size: 16, weight: .medium))
Image(systemName: "checkmark.circle")
.font(.system(size: 16, weight: .semibold))
Image(systemName: "checkmark.circle")
.font(.system(size: 16, weight: .bold))
Image(systemName: "checkmark.circle")
.font(.system(size: 16, weight: .heavy))
Image(systemName: "checkmark.circle")
.font(.system(size: 16, weight: .black))
SF Symbols are similar to fonts, thus:
.font(.system(size: 60))
An alternative is to use .imageScale()
.
Image(systemName: "chevron.left").imageScale(.small)
Image(systemName: "chevron.left").imageScale(.medium)
Image(systemName: "chevron.left").imageScale(.large)
If you want to use frame you can as well:
Image(systemName: "plus")
.resizable()
.scaledToFit()
.frame(width: 24, height: 24)