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

URL Link selected font #425

Open
nikeshakya opened this issue Jun 23, 2023 · 0 comments
Open

URL Link selected font #425

nikeshakya opened this issue Jun 23, 2023 · 0 comments

Comments

@nikeshakya
Copy link

nikeshakya commented Jun 23, 2023

I have customized label to have bold font for url links
It works for the first time, but after the link is clicked, the font attribute just invalidates for link...it changes back to normal font

here is my implementation:

self.configureLinkAttribute =  { (type, attributes, isSelected) in
            var atts = attributes
            switch type {
            case .url:
                if self.underlineLink {
                    atts[NSAttributedString.Key.underlineStyle] = NSUnderlineStyle.thick.rawValue
                }
                if let font = self.linkFont {
                    atts[NSAttributedString.Key.font] = font
                }
                break
            default:
                atts[NSAttributedString.Key.underlineStyle] = 0
                break
            }
            return atts
 }
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