Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save douglashill/ed9ee678db17337e08fcf739e207286f to your computer and use it in GitHub Desktop.
Save douglashill/ed9ee678db17337e08fcf739e207286f to your computer and use it in GitHub Desktop.
Compact description of an iOS content size category. Useful for analytics.
private extension UIContentSizeCategory {
var shortDescription: String {
switch self {
case .unspecified: return "unspecified"
case .extraSmall: return "XS"
case .small: return "S"
case .medium: return "M"
case .large: return "L"
case .extraLarge: return "XL"
case .extraExtraLarge: return "XXL"
case .extraExtraExtraLarge: return "XXXL"
case .accessibilityMedium: return "AX M"
case .accessibilityLarge: return "AX L"
case .accessibilityExtraLarge: return "AX XL"
case .accessibilityExtraExtraLarge: return "AX XXL"
case .accessibilityExtraExtraExtraLarge: return "AX XXXL"
default: return rawValue
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment