Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UIButton & UILabel setFAText size parameter changes icon size only, not font size #65

Open
JB288 opened this issue Feb 10, 2017 · 0 comments

Comments

@JB288
Copy link

JB288 commented Feb 10, 2017

In the UIButton and UILabel extensions, the setFAText function takes a parameter:

size: CGFloat?

I took this parameter to mean the size of the button/label text. There is an iconSize parameter which I took to mean the size of the icon. The function seems to use size and iconSize both as the size of the icon, leaving the text size unchanged.

If it is correct to assume the size parameter should be the size of the text (and icon if the iconSize parameter is null or not passed) then I think this is a bug. I commented out this line (numbers 113 and 192 in v 1.6.1):

//let textAttribute = [NSFontAttributeName:textFont!] 

and put these three lines above the commented out line:

let textFontSize = size ?? textFont!.pointSize 
let sizedTextFont = UIFont(name: textFont!.fontName, size: textFontSize)
let textAttribute = [NSFontAttributeName: sizedTextFont]

and it seemed to resize the text.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant