iosios-simulatortext-sizedynamic-type-feature

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?


Solution

  • 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 an 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