Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a faster way to change accessibility (dynamic type) text size on iOS simulator?

On my iPhone XS, I created a shortcut in the Control Center to quickly change the text size and test to make sure all the sizes work on my iPhone.

However, I'm often in the simulator trying to test, and it's tedious to need to switch to the Settings app and go through multiple menus to switch the text size.

Since the simulator has no Control Center, is there another way to more easily change the text size?

like image 476
teradyl Avatar asked Sep 23 '19 23:09

teradyl


People also ask

How do I change font size in Iphone simulator?

In the simulator, go into settings (Choose "Home" on the hardware menu). Then General->Accessibility->Larger text. You also should slide the switch at the top to "Larger Accessibility Sizes". You'll then get a slider to adjust the text size.

What is dynamic font in iOS?

The Dynamic Type feature allows users to choose the size of textual content displayed on the screen. It helps users who need larger text for better readability. It also accomodates those who can read smaller text, allowing more information to appear on the screen.

How do I change the script size on my Iphone?

Go to Settings > Accessibility > Display & Text Size. Adjust any of the following: Bold Text: Display the text in boldface characters. Larger Text: Turn on Larger Accessibility Sizes, then adjust the text size using the Font Size slider.

Does iOS simulator simulate performance?

The simulator does a really lousy job of indicating app performance. In fact it doesn't try. For most things the simulator is much, much faster than an iOS device. It runs your code on an x86 processor, which is much faster than the ARM and has many times more memory.

How do I add dynamic type to my App?

To add support for Dynamic Type in your app, you use text styles. A text style describes the use of the text, such as headline or body or title1, and lets the system know how best to adjust its size. You can configure text styles in either Interface Builder or your source code.

How to scale text in your interface automatically?

Scale text in your interface automatically using Dynamic Type. The Dynamic Type feature allows users to choose the size of textual content displayed on the screen. It helps users who need larger text for better readability.

What are the different types of text styles for iOS devices?

xSmall, Small, Medium, Large (Default), xLarge, xxLarge, xxxLarge, AX1, AX2, AX3, AX4, AX5. If you’re using the iOS built-in text styles, you get support for Dynamic Type out of the box. We’ll go into more detail about these built-in text styles later, as they will come into play a little more with supporting custom fonts.

What does adjustsfontforcontentsizecategory do?

This setting tells the text control to adjust the text size based on the Dynamic Type setting provided by the user. If the adjustsFontForContentSizeCategory property is set to false, the font will initially be the right size, but it won't respond to text-size changes the user makes in Settings or Control Center.


Video Answer


2 Answers

The best way to reach your goal depends on the Xcode version you're using.

In Xcode 10, go to the Xcode - Open Developer Tool menu and select the Accessibility Inspector element: enter image description here

  1. If you haven't run your simulator, do it now and select it in the panel.
  2. Select the Settings button to display the different text sizes.
  3. Test your dynamic type implementation by changing the font size.

If you need further explanation about this tool, I strongly recommend to take a look at these WWDC detailed summaries that contain very useful information: 2016 and 2019.

In Xcode 11, there's a new option directly accessible from the debug bar in the LOG window: if you haven't run your simulator, do it now and select the LOG window in Xcode: enter image description here

  1. Select the Environment Overrides button to open the new pane.
  2. Switch the TEXT on, vary the text size and dynamically visualize its rendering on the simulator.

Using these tools is, in my view, the fastest way to test the Dynamic Type feature implementation.

⚠️ EDIT 2022/06/24 ⚠️

SwiftUI in Xcode 14 provides a new live previews that are interactive by default: your changes are immediately updated in the canvas and displayed in all sizes as you make them. 👍 enter image description here

like image 133
XLE_22 Avatar answered Dec 07 '22 15:12

XLE_22


You can create a new dedicated simulator for that font size, which you can quickly choose from Xcode. For example:

  1. Create a new simulator by tapping on “Window” » “Devices and Simulators” and tapping on the “+” button in the lower left corner:

    enter image description here

  2. Now, when you run the app from Xcode you can choose this new simulator where you “Choose scheme” in the Xcode toolbar:

    enter image description here

    For example:

    enter image description here

  3. Once you run the app on the simulator, jump to the “Settings” and change your font size there. You now have the two simulators that you can quickly choose from from the Xcode UI. You can even run the app simultaneously from both and watch how your app is rendered in both:

    enter image description here

like image 44
Rob Avatar answered Dec 07 '22 15:12

Rob