Skip to content

Instantly share code, notes, and snippets.

@rudrankriyam
Last active October 25, 2020 11:19
Show Gist options
  • Select an option

  • Save rudrankriyam/0971954611d8e0a1e404861302841c93 to your computer and use it in GitHub Desktop.

Select an option

Save rudrankriyam/0971954611d8e0a1e404861302841c93 to your computer and use it in GitHub Desktop.
Accessibility in iOS 14 Widgets With SwiftUI
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