diff --git a/iOSClient/Main/Collection Common/Cell/NCGridCell.swift b/iOSClient/Main/Collection Common/Cell/NCGridCell.swift index 3a7d4bbf9f..549f93fb82 100644 --- a/iOSClient/Main/Collection Common/Cell/NCGridCell.swift +++ b/iOSClient/Main/Collection Common/Cell/NCGridCell.swift @@ -87,11 +87,49 @@ class NCGridCell: UICollectionViewCell, UIGestureRecognizerDelegate, NCCellMainP imageLocal.image = nil labelTitle.text = "" - labelExtension?.text = "" - labelExtension?.isHidden = true + labelExtension.text = "" + labelExtension.isHidden = true labelInfo.text = "" labelSubinfo.text = "" + // Dynamic Type Font Configuration + // + // These labels use fonts generated by the custom UIFont helpers defined in + // the UIFont extension (e.g. `.callout()`, `.caption1()`). + // + // Those helpers wrap `UIFontMetrics` to provide Dynamic Type scaling while + // applying an upper bound to the maximum font size. This ensures: + // + // - The text respects the user's preferred accessibility size. + // - The UI layout remains stable and does not grow indefinitely. + // + // `adjustsFontForContentSizeCategory` is enabled to allow UIKit to + // automatically update the font when the user changes the Dynamic Type + // setting while the application is running. + // + // Without this flag, the label would keep the initially computed font size + // and would not react to content size category changes. + // + // In summary: + // + // UIFont helper: + // Defines how the font scales and its maximum size. + // + // adjustsFontForContentSizeCategory: + // Enables live updates when accessibility settings change. + // + labelTitle.font = .callout() + labelTitle.adjustsFontForContentSizeCategory = true + + labelExtension.font = .callout() + labelExtension.adjustsFontForContentSizeCategory = true + + labelInfo.font = .caption1() + labelInfo.adjustsFontForContentSizeCategory = true + + labelSubinfo.font = .caption1() + labelSubinfo.adjustsFontForContentSizeCategory = true + imageVisualEffect.layer.cornerRadius = 6 imageVisualEffect.clipsToBounds = true imageVisualEffect.alpha = 0.5 diff --git a/iOSClient/Main/Collection Common/Cell/NCGridCell.xib b/iOSClient/Main/Collection Common/Cell/NCGridCell.xib index a32b9dfb83..bed4152326 100644 --- a/iOSClient/Main/Collection Common/Cell/NCGridCell.xib +++ b/iOSClient/Main/Collection Common/Cell/NCGridCell.xib @@ -1,8 +1,8 @@ - + - + @@ -37,17 +37,17 @@ - + - @@ -55,15 +55,15 @@ -