Skip to main content
The 2024 Developer Survey results are live! See the results

All Questions

3 votes
1 answer
711 views

maximumContentSizeCategory in iOS 14

In our recent project, we're trying to add Dynamic Text Sizing support. Our app is supporting iOS 14 and above. In iOS 15, we can limit the text sizing using the property maximumContentSizeCategory ...
PGDev's user avatar
  • 24.1k
0 votes
2 answers
1k views

Dynamic Text Sizing in NSAttributedString

I'm trying to support Large Font Accessibility in the app. There are places where we are using NSAttributedString to set the attributedText of a UILabel. On UILabel, we've set ...
PGDev's user avatar
  • 24.1k
3 votes
2 answers
2k views

Bold dynamic type in Swift

How come for a dynamic font on a UILabel where we have the following: artistLabel.font = UIFont.preferredFont(forTextStyle: .body, compatibleWith: UITraitCollection(legibilityWeight: .regular))...
WishIHadThreeGuns's user avatar
2 votes
4 answers
1k views

Is there a way to set something like adjustsfontsizetofitwidth on UITabBarItem

Trying to get my app accessible for all users and I stumbled upon an issue when creating the items for the TabBar and would love to have a way of fixing it. I got something like this in my project: ...
Trebligul's user avatar
1 vote
1 answer
1k views

UICollectionView autosize cell with dynamic number of columns using Accessibility

I'm trying to mimic the behavior of the current Shortcuts app UICollectionView where the default display of items is in a 2 column layout, but depending on the font size, it changes to a single column ...
gmogames's user avatar
  • 3,041
1 vote
3 answers
2k views

How to use Dynamic Type in TextView inside Table View Cell

I want to implement Dynamic Type in my application, so the app can adapt to user font preference. I have a Table View with 3 static cells. The first and second one has UITextField and they work fine ...
ShadeToD's user avatar
  • 470
4 votes
1 answer
1k views

Can UIButton background image support Dynamic Type?

After watching this talk I would like to support Dynamic Type in my app. It's easy for labels, but what about UIButton with an image set as a background? Image is in pdf, single scale and Preserve ...
Adam Smaka's user avatar
  • 6,303
9 votes
2 answers
4k views

Default UIFont size and weight but also support preferredFontForTextStyle

If I have my own group of UIFonts with different sizes and weights, for example: let customFont03 = UIFont.systemFont(ofSize: 40, weight: .thin) How can I support Dynamic Type while still preserving ...
Turnipdabeets's user avatar
6 votes
1 answer
1k views

Add dynamic type to a UISearchBar

My question is pretty much stated in the title. I'm trying to add dynamic type (as defined here) to a UISearchBar with no luck. I know this is possible as the system apps seem to be able to handle it ...
Harish's user avatar
  • 1,408
6 votes
2 answers
4k views

UIFontMetrics: scaled font size calculation

In iOS 11 UIFontMetrics class was introduced. I did some experimenting but I didn't understand how scaledFont(for:) method calculates the font size of returned font. For example, Apple says that for ...
Giorgio's user avatar
  • 2,068
13 votes
2 answers
7k views

How to make NSMutableAttributedString responsive with dynamic type text from settings app

let dictTitleColor = [NSAttributedStringKey.foregroundColor: UIColor.LTColor()] let titleAttributedString = NSMutableAttributedString(string: title, attributes: dictTitleColor) alert.setValue(...
Amey's user avatar
  • 805
4 votes
4 answers
4k views

iOS dynamic type - set minimum font size

I would definitely like to use dynamic type as much as possible within an iOS app - I like the idea that the user can choose whatever size they prefer. However, when the font size is set to some of ...
Cailean Wilkinson's user avatar
5 votes
3 answers
5k views

How to get iOS font size and set it to all labels of the app?

I want to make an app, where font size increase or decrease according to font size maintained in iOS in Settings. If you change font size of your iOS from settings, whatsapp font size displayed ...
Tejinder's user avatar
  • 1,537
6 votes
5 answers
7k views

Disabling Dynamic Type in Swift

I have a Sprite Kit based game that uses a UIView within one of the scenes, and I do that so that I can take advantage of the UITableViewController to present a game settings screen. The difficulty ...
zeeple's user avatar
  • 5,589