SF Symbols
iOS 13
weight
iOS development
Apple design

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

SF Symbols, introduced by Apple, is a set of over 1,500 configurable icons. They are designed to work seamlessly with the core system fonts on iOS, macOS, and other Apple platforms. With iOS 13, developers gained access to these icons that could be customized in various ways, including adjusting their weight. This article provides a step-by-step guide on how to set the weight for SF Symbols in an iOS 13 application, ensuring that your app's icons are visually consistent with the rest of your UI.

Understanding SF Symbols in iOS 13

Apple released SF Symbols as part of the San Francisco family of fonts, which are dynamic and adaptable to different font sizes and weights. The available weights for SF Symbols include:

  • ultralight
  • thin
  • light
  • regular
  • medium
  • semibold
  • bold
  • heavy
  • black

These weights allow developers to create icons that match the typography of the app. However, SF Symbols depend on Dynamic Type, which means they adjust based on the user's accessibility settings.

Technical Requirements

To efficiently customize SF Symbols in your project, ensure you are using:

  • Xcode 11 or later: This version includes the SF Symbols app, which allows you to preview the icons and test various configurations.
  • iOS 13 or later: As SF Symbols are natively supported from iOS 13 onwards.

Setting a Weight for SF Symbols

Step-by-step Implementation

Here is how you can implement different symbol weights in your iOS app using Swift:

  1. Import SF Symbols: The SF Symbols are integrated into the system’s UIFont and UIImage for easy use.
  2. Create a UIImage with desired Symbol:
  • Symbol Rendering: SF Symbols are vector based, allowing them to scale appropriately without loss of quality.
  • Weight Alignment: Ensure the weight you choose for your symbols matches the typography to maintain cohesive design language. Symbols that are too thin or thick compared to text can look out-of-place.
  • Localization: Adjust symbol positioning for localized text to maintain a consistent appearance.

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