Last active
October 25, 2020 11:19
-
-
Save rudrankriyam/0971954611d8e0a1e404861302841c93 to your computer and use it in GitHub Desktop.
Accessibility in iOS 14 Widgets With SwiftUI
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import SwiftUI | |
| struct SimpleEntryView: View { | |
| var entry: Provider.Entry | |
| @Environment(\.sizeCategory) var category | |
| var body: some View { | |
| if category.isAccessibilityCategory { | |
| // Handle design for accessibility text sizes | |
| } else { | |
| // Handle design for normal text sizes | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment