Trikalabs
  • Home
  • Best online TDD videos
  • Book Suggestions
  • About Me
  • Contact
Trikalabs
No Result
View All Result

Large Content Viewer

by fragi
May 13, 2021
in Accessibility
Share on FacebookShare on Twitter

Although scaling dynamic type is preferred whenever possible, there are cases as the navigation bars, the tab bars, the toolbars and the status bar where views have fixed height. The reason for assigning fixed height to these views is because otherwise they will take significant size of the screen and users will not be able to focus on the main content. In these cases we can use the Large Content Viewer to provide an accessible interface.
The Large Content Viewer works only when the text is assigned to one of large Accessibility text sizes. 

Let’s try to create a tab view with two items, as follows

Swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
struct ContentView: View {
    var body: some View {
        TabView {
            Text("With System Image")
                .tabItem {
                    Image(systemName: "figure.walk")
                    Text("Walk")
                }
            Text("Without preserving vector data")
                .tabItem {
                    Image("walk")
                    Text("Walk")
                }
            //Photo by <a href="https://unsplash.com/@bernardhermant?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Bernard Hermant</a> on <a href="https://unsplash.com/s/photos/icon-black-and-white?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Unsplash</a>
            
        }
    }
}

That results to the below screen. 

By using one of the larger Accessibility texts, by long tapping on top of the tab bar items we see the Large Content Viewer.

In the above example we notice that the first tab produces a great experience on the Large Content Viewer, but the second is not.
The reason why the second is bar item produces a bad experience is because the image asset is not a system image but a custom jpg image. In order to fix it we should provide a pdf asset and select to preserve the vector data. Alternatively if we are using UIKit or create a custom bar we can provide an alternative image and/or text for the Large Content Viewer. More details can be found on this WWDC video: https://developer.apple.com/videos/play/wwdc2019/261/

Tags: AccessibilityLarge content viewerSwiftUI
fragi

fragi

Related Posts

Accessibility by Example
Accessibility

Accessibility – AutoResizable views

February 18, 2022

Allow a user to select the text size is a must if your app wants to be accessible. IOS already...

Accessibility by Example
Accessibility

Accessibility by Example

January 28, 2022

This post contains notes and screenshots from WWDC accessibility videos. Accessibility in SwiftUI (WWDC 2019) - Add label to describe...

Large Content Viewer
Accessibility

SwiftUI – Accessibility for Images

May 13, 2021

Supporting dynamic type for text is essential to make the app accessible. Making images accessible sometimes is out of the...

Next Post
Large Content Viewer

SwiftUI - Accessibility for Images

What is TDD?

FizzBuzzThrow - step by step TDD

What is TDD?

What is TDD?

  • Advertise
  • Privacy & Policy
  • Contact

© 2019 Trikalabs Ltd. All rights reserved.

No Result
View All Result
  • Home
  • About Me
  • A curated list with the best free online TDD videos
  • Book Suggestions
  • Pinner Code Club

© 2019 Trikalabs Ltd. All rights reserved.