iOS
minimum font size
iOS 6.0 update
deprecated features
mobile typography

Minimum Font Size deprecated on ios version 6.0

Master System Design with Codemia

Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.

Introduction

When developers see that minimumFontSize was deprecated on iOS 6, the replacement is usually not "do nothing." The modern approach is to let the label shrink proportionally by combining adjustsFontSizeToFitWidth with minimumScaleFactor. That keeps text readable while fitting within the available width in a way that matches newer UIKit behavior.

What Was Deprecated

Older UIKit code often looked like this:

objc
label.adjustsFontSizeToFitWidth = YES;
label.minimumFontSize = 10.0;

The deprecated part is minimumFontSize. Apple replaced that API with a scaling-based model. Instead of specifying an absolute fallback size, you specify the minimum scale factor relative to the label’s original font.

Use minimumScaleFactor Instead

In modern UIKit, the usual replacement is:

swift
1let label = UILabel()
2label.font = UIFont.systemFont(ofSize: 20)
3label.adjustsFontSizeToFitWidth = true
4label.minimumScaleFactor = 0.5
5label.numberOfLines = 1
6label.text = "A very long title that should shrink if needed"

This means:

  • start from a 20-point font
  • allow the label to shrink to 50 percent of that size
  • keep the text on one line

So the effective minimum would be 10 points, but it is expressed as a scale rather than a fixed absolute value.

Why Apple Moved to Scale Factor

The scaling model works better with dynamic layout because it is relative to the label’s base font. If you later change the font from 20 points to 24 points, a minimumScaleFactor of 0.5 still behaves sensibly. The old fixed-size property did not adapt as elegantly when the base font changed.

This also made it easier for UIKit to reason about text fitting across different devices and layouts.

A Complete UIKit Example

Here is a small view controller example that shows the modern pattern:

swift
1import UIKit
2
3final class TitleViewController: UIViewController {
4    override func viewDidLoad() {
5        super.viewDidLoad()
6        view.backgroundColor = .systemBackground
7
8        let label = UILabel()
9        label.translatesAutoresizingMaskIntoConstraints = false
10        label.font = UIFont.systemFont(ofSize: 24, weight: .semibold)
11        label.text = "This is a long title that may need to shrink"
12        label.numberOfLines = 1
13        label.adjustsFontSizeToFitWidth = true
14        label.minimumScaleFactor = 0.6
15
16        view.addSubview(label)
17        NSLayoutConstraint.activate([
18            label.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: 20),
19            label.trailingAnchor.constraint(equalTo: view.trailingAnchor, constant: -20),
20            label.centerYAnchor.constraint(equalTo: view.centerYAnchor)
21        ])
22    }
23}

If the text does not fit in the horizontal space, UIKit shrinks it until it reaches the configured minimum scale factor.

Understand the Relationship Between the Two Properties

minimumScaleFactor does not do anything by itself. It works together with adjustsFontSizeToFitWidth.

That means this setup is incomplete:

swift
label.minimumScaleFactor = 0.5

Without this, the label will not shrink:

swift
label.adjustsFontSizeToFitWidth = true

You usually want both, especially for single-line labels that must fit into constrained horizontal space.

Consider Dynamic Type Too

Shrinking text to fit is not the same thing as supporting accessibility text sizes. If the label represents regular app content rather than a one-line badge or title, Dynamic Type may be a better answer than aggressive auto-shrinking.

For modern apps, that can look like:

swift
label.font = UIFont.preferredFont(forTextStyle: .headline)
label.adjustsFontForContentSizeCategory = true

Dynamic Type and minimumScaleFactor solve different problems:

  • Dynamic Type respects user accessibility settings
  • 'minimumScaleFactor helps a specific label fit within a tight width'

Use them intentionally instead of treating shrinking as a universal typography solution.

Migrating Old Objective-C Code

If you are maintaining older Objective-C code, the same concept applies:

objc
self.titleLabel.adjustsFontSizeToFitWidth = YES;
self.titleLabel.minimumScaleFactor = 0.5;

So migration from the deprecated property is usually straightforward. Replace the absolute minimum font size with a scale factor computed from your old intended minimum.

If the old code used a 20-point font and minimumFontSize of 12, the equivalent scale factor is 12.0 / 20.0, which is 0.6.

Common Pitfalls

The biggest mistake is setting minimumScaleFactor and expecting it to work without adjustsFontSizeToFitWidth. Another is leaving numberOfLines unconstrained when the real intent is single-line shrink-to-fit behavior. Developers also use scale factor to solve layout problems that should really be fixed with better constraints or line wrapping. Finally, shrinking text too aggressively can hurt readability, so a tiny minimum scale factor is rarely a good design choice.

Summary

  • 'minimumFontSize was deprecated, and minimumScaleFactor is the usual replacement.'
  • Use minimumScaleFactor together with adjustsFontSizeToFitWidth.
  • Think in terms of relative scaling from the base font, not a fixed fallback size.
  • Convert old fixed sizes into a ratio when migrating legacy code.
  • Use Dynamic Type for accessibility, not just label shrinking.
  • Avoid relying on text shrinking to hide broader layout issues.

Course illustration
Course illustration

All Rights Reserved.