CPCFontMetricsProtocol
internal protocol CPCFontMetricsProtocol
Protocol that hides Dynamic Font implementation differences between iOS 10 and iOS 11+.
-
scaledValue(_:)Default implementationGet an arbitrary scaled value for current content size category.
Default Implementation
Declaration
Swift
func scaledValue(_ value: CGFloat) -> CGFloatParameters
valueValue to scale.
Return Value
value, scaled according to user-selected content size category. -
Get an arbitrary scaled value for a given
contentSizeCategory.Declaration
Swift
func scaledValue(_ value: CGFloat, for contentSizeCategory: UIContentSizeCategory) -> CGFloatParameters
valueValue to scale.
contentSizeCategoryContent size category to scale for.
Return Value
value, scaled according to given content size category. -
scaledInsets(_:)Default implementationGet insets, scaled for current content size category.
Default Implementation
Declaration
Swift
func scaledInsets(_ insets: UIEdgeInsets) -> UIEdgeInsetsParameters
insetsInsets to scale.
Return Value
insets, scaled according to user-selected content size category. -
scaledInsets(_:for:)Default implementationGet insets, scaled for a given
contentSizeCategory.Default Implementation
Declaration
Swift
func scaledInsets(_ insets: UIEdgeInsets, for contentSizeCategory: UIContentSizeCategory) -> UIEdgeInsetsParameters
insetsInsets to scale.
contentSizeCategoryContent size category to scale for.
Return Value
insets, scaled according to given content size category. -
scaledFont(_:)Default implementationGet font, scaled for current content size category.
Default Implementation
Declaration
Swift
func scaledFont(_ font: UIFont) -> UIFontParameters
fontFont to scale.
Return Value
font, scaled according to user-selected content size category. -
scaledFont(_:for:)Default implementationGet font, scaled for a given
contentSizeCategory.Default Implementation
Declaration
Swift
func scaledFont(_ font: UIFont, for contentSizeCategory: UIContentSizeCategory) -> UIFontParameters
fontFont to scale.
contentSizeCategoryContent size category to scale for.
Return Value
font, scaled according to given content size category.
View on GitHub
Install in Dash
CPCFontMetricsProtocol Protocol Reference