wordpress-mobile / WordPress-iOS-Shared

Shared components used in building the WordPress iOS apps and other library components
GNU General Public License v2.0
18 stars 22 forks source link

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

Open staskus opened 2 years ago

staskus commented 2 years ago

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.