-
Notifications
You must be signed in to change notification settings - Fork 83
Open
Description
Here is a real example of the issue I'm facing:
An attributed text with an icon set in a UIButton.
let button = UIButton(type: .system)
let attachment = TextAttachment()
attachment.image = MediaActionType.connect.iconImage
let attributedString = "".withAttachment(attachment) + " Connect With \(name)".withTextColor(.brand).withFont(.brandon(style: .medium, size: 16.0))
button.setAttributedTitle(attributedString, for: .normal)This doesn't show the icon but if works if I use NSMutableAttributedString directly:
let button = UIButton(type: .system)
let attachment = TextAttachment()
attachment.image = MediaActionType.connect.iconImage
let mutableAttributedString = NSMutableAttributedString()
mutableAttributedString.append(NSAttributedString(attachment: attachment))
mutableAttributedString.append(" Connect With \(name)".withTextColor(.brand).withFont(.brandon(style: .medium, size: 16.0)))
button.setAttributedTitle(mutableAttributedString, for: .normal)I'm using Xcode 13.1, CocoaPods and SwiftyAttributes version is 5.1.1.
Any thoughts?
Thank you.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels