Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 

README.md

CustomLabel

Blog for Custom UILabel Effects.

Check full blog from here.

Make Custom label for OutLine effect

let strokeTextAttributes = [ 
    NSAttributedStringKey.strokeColor : UIColor.red,
    NSAttributedStringKey.foregroundColor : UIColor.white,
    NSAttributedStringKey.strokeWidth : -4.0,
    NSAttributedStringKey.font : UIFont.boldSystemFont(ofSize: 30)]
    as [NSAttributedStringKey : Any]
//Making outline here
labelOutLine.attributedText = NSMutableAttributedString(string: “Your outline text”, attributes: strokeTextAttributes) 

Make Custom label for UnderLine effect

let attributedString = NSMutableAttributedString(string: “Your UnderLine text”)
attributedString.addAttribute(NSAttributedStringKey.underlineStyle, value: NSUnderlineStyle.styleSingle.rawValue, range: NSRange(location: 0, length: attributedString.length))
//Underline effect here
labelUnderLine.attributedText = attributedString

About

Blog for Custom UILabel Effects.

Topics

Resources

License

Packages

No packages published

Languages

You can’t perform that action at this time.