iOS 13
SF Symbols
icon customization
weight adjustment
iOS development

How do I set a weight to SF Symbols for iOS 13?

Interview Questions practice on Codemia

Over 8,000 real interview questions from top companies, searchable by company and role.

Browse interview questions

Introduction

On iOS 13, you set SF Symbol weight through UIImage.SymbolConfiguration. SF Symbols are treated like typographic glyphs, so weight, scale, and point size are configured as part of the symbol image configuration rather than by editing the vector asset manually.

The Basic API

The normal pattern is:

  • create a system symbol image
  • create a symbol configuration with the desired weight
  • apply that configuration to the image
swift
1import UIKit
2
3let image = UIImage(systemName: "heart.fill")
4let config = UIImage.SymbolConfiguration(weight: .bold)
5let weightedImage = image?.applyingSymbolConfiguration(config)

That works on iOS 13 and later for supported symbols.

Set Size and Weight Together

In most UI code, you want point size and weight as one package so the symbol matches nearby text.

swift
1import UIKit
2
3let config = UIImage.SymbolConfiguration(pointSize: 24, weight: .semibold)
4let image = UIImage(systemName: "paperplane.fill", withConfiguration: config)

This is often the cleanest form because the image is created with the desired configuration immediately.

Applying to an Image View

swift
1import UIKit
2
3let imageView = UIImageView()
4let config = UIImage.SymbolConfiguration(pointSize: 20, weight: .medium)
5imageView.image = UIImage(systemName: "bolt.fill", withConfiguration: config)
6imageView.tintColor = .systemYellow

The weight controls the symbol stroke style. The tint color controls the rendered color when the symbol uses template rendering.

Matching Text Weight

A useful pattern is to align the symbol with a font.

swift
1import UIKit
2
3let font = UIFont.systemFont(ofSize: 18, weight: .regular)
4let config = UIImage.SymbolConfiguration(font: font)
5let image = UIImage(systemName: "star.fill", withConfiguration: config)

This is especially helpful in buttons, labels with attachments, or navigation items where visual consistency matters more than hard-coded icon values.

Combining Configurations

You can also combine symbol configuration values.

swift
1import UIKit
2
3let base = UIImage.SymbolConfiguration(pointSize: 22)
4let weight = UIImage.SymbolConfiguration(weight: .light)
5let combined = base.applying(weight)
6
7let image = UIImage(systemName: "cloud.sun.fill", withConfiguration: combined)

That is useful when one piece of code controls size and another controls styling.

Watch for Symbol Availability

The API for symbol configuration exists on iOS 13, but not every SF Symbol name is available on every OS release. If a symbol was introduced later, UIImage(systemName:) returns nil on older systems.

A safe pattern is:

swift
if let image = UIImage(systemName: "person.crop.circle") {
    imageView.image = image.applyingSymbolConfiguration(.init(weight: .regular))
}

So if your issue is "weight does nothing," first make sure the symbol itself exists and the image is not nil.

Weight Is Not Tint and Not Font Weight on the View

A common misunderstanding is trying to make a symbol look bolder by changing only tint color or by changing the font on an unrelated control. SF Symbol weight is part of the image configuration itself.

This means the correct place to set it is the symbol configuration, not a random property on UIImageView.

Common Pitfalls

The biggest mistake is assuming iOS 13 lacks symbol weight support. The configuration API is available there.

Another mistake is setting a configuration but not actually applying it to the image being displayed.

A third issue is using a symbol name that does not exist on the iOS version you are testing, which makes it look like weight configuration failed when the image is actually nil.

Finally, do not confuse weight with scale. small, medium, and large scale affect overall symbol proportion, while weight affects stroke thickness.

Summary

  • On iOS 13, set SF Symbol weight with UIImage.SymbolConfiguration.
  • You can configure weight alone or combine it with point size or font.
  • Apply the configuration either during image creation or with applyingSymbolConfiguration.
  • Make sure the symbol name exists on the iOS version you are targeting.
  • Weight, scale, and tint are separate concerns.
  • Most problems come from not applying the configuration or from using an unavailable symbol.

Related reading
Free course
Beginner
7 lessons
2 hours
Tackling System Design Interview Problems

A short course that equips you with the skills to approach system design interviews methodically.

Start the free course
Basis Lab
No course covers this one yet

Basis Lab writes one for you from a sentence about what you want to be able to do, then teaches it and checks you understood. Your first course is free.

Build my course
Track what you have practised

A free account saves your progress, solutions and study plan across every problem on Codemia.

Interview Questions practice on Codemia

Over 8,000 real interview questions from top companies, searchable by company and role.

Browse interview questions