-
Notifications
You must be signed in to change notification settings - Fork 108
Why is text centered when setting icon to UILabel? #32
Copy link
Copy link
Open
Description
Why does the function UILabel.setIcon(...) change the alignment of the text on the label to .center? The documentation on these functions do not specify that the alignment is changed. I found this to be unexpected behavior and I don't want to the alignment on my label to be changed when using this function.
Found in SwiftIcons.swift in the following functions:
setIcon(prefixText: String, prefixTextColor: UIColor = .black, icon: FontType?, iconColor: UIColor = .black, postfixText: String, postfixTextColor: UIColor = .black, size: CGFloat?, iconSize: CGFloat? = nil) {
// ...
textAlignment = .center
}
setIcon(prefixText: String, prefixTextFont: UIFont, prefixTextColor: UIColor = .black, icon: FontType?, iconColor: UIColor = .black, postfixText: String, postfixTextFont: UIFont, postfixTextColor: UIColor = .black, iconSize: CGFloat? = nil) {
// ...
textAlignment = .center
}
Is there a reason why the alignment is changed? If not I would suggest removing the line.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels