WordPress-iOS-Shared icon indicating copy to clipboard operation
WordPress-iOS-Shared copied to clipboard

fontForTextStyle(_ style: maximumPointSize:) doesn't use maximumPointSize parameter in the implementation

Open staskus opened this issue 3 years ago • 0 comments

fontForTextStyle(_ style: maximumPointSize:) doesn't use maximumPointSize parameter in the implementation. This method is used in some parts of the WordPress-iOS application and is features in the accessibility guide.

It was removed in the https://github.com/wordpress-mobile/WordPress-iOS-Shared/pull/294 PR.

    @objc public class func fontForTextStyle(_ style: UIFont.TextStyle, maximumPointSize: CGFloat = maxFontSize) -> UIFont {
        let fontDescriptor = UIFontDescriptor.preferredFontDescriptor(withTextStyle: style)
        return UIFont(descriptor: fontDescriptor, size: fontDescriptor.pointSize)
    }

a) If we don't want to support maximumPointSize anymore, remove it from method signature. b) If we want to support maximumPointSize change implementation to use fontDescriptor method that uses maximumPointSize.

staskus avatar Sep 29 '22 11:09 staskus